mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
70 lines
2.0 KiB
JavaScript
70 lines
2.0 KiB
JavaScript
// eslint-disable-next-line import/no-commonjs
|
|
module.exports = {
|
|
root: true,
|
|
env: {
|
|
node: true,
|
|
},
|
|
parser: '@typescript-eslint/parser',
|
|
plugins: ['prettier', '@typescript-eslint', 'type-graphql', 'jest', 'import'],
|
|
extends: [
|
|
'standard',
|
|
'eslint:recommended',
|
|
'plugin:prettier/recommended',
|
|
'plugin:import/recommended',
|
|
'plugin:import/typescript',
|
|
],
|
|
settings: {
|
|
'import/resolver': {
|
|
typescript: true,
|
|
node: true,
|
|
},
|
|
},
|
|
rules: {
|
|
'no-console': ['error'],
|
|
'no-debugger': 'error',
|
|
'prettier/prettier': [
|
|
'error',
|
|
{
|
|
htmlWhitespaceSensitivity: 'ignore',
|
|
},
|
|
],
|
|
// jest
|
|
'jest/no-disabled-tests': 'error',
|
|
'jest/no-focused-tests': 'error',
|
|
'jest/no-identical-title': 'error',
|
|
'jest/prefer-to-have-length': 'error',
|
|
'jest/valid-expect': 'error',
|
|
// import
|
|
'import/no-deprecated': 'error',
|
|
'import/no-empty-named-blocks': 'error',
|
|
'import/no-mutable-exports': 'error',
|
|
'import/no-unused-modules': 'error',
|
|
'import/no-commonjs': 'error',
|
|
'import/no-import-module-exports': 'error',
|
|
},
|
|
overrides: [
|
|
// only for ts files
|
|
{
|
|
files: ['*.ts', '*.tsx'],
|
|
extends: [
|
|
'plugin:@typescript-eslint/recommended',
|
|
'plugin:@typescript-eslint/recommended-requiring-type-checking',
|
|
'plugin:type-graphql/recommended',
|
|
],
|
|
rules: {
|
|
// allow explicitly defined dangling promises
|
|
'@typescript-eslint/no-floating-promises': ['error', { ignoreVoid: true }],
|
|
'no-void': ['error', { allowAsStatement: true }],
|
|
// ignore prefer-regexp-exec rule to allow string.match(regex)
|
|
'@typescript-eslint/prefer-regexp-exec': 'off',
|
|
},
|
|
parserOptions: {
|
|
tsconfigRootDir: __dirname,
|
|
project: ['./tsconfig.json'],
|
|
// this is to properly reference the referenced project database without requirement of compiling it
|
|
EXPERIMENTAL_useSourceOfProjectReferenceRedirect: true,
|
|
},
|
|
},
|
|
],
|
|
}
|