FoundKey/packages/backend/.eslintrc.js

74 lines
2 KiB
JavaScript
Raw Normal View History

2021-11-12 01:35:41 +00:00
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
2021-11-12 01:58:13 +00:00
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
},
2021-11-12 01:35:41 +00:00
plugins: [
'@typescript-eslint',
'import'
],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:import/recommended',
'plugin:import/typescript'
],
rules: {
'indent': ['warn', 'tab', {
'SwitchCase': 1,
'MemberExpression': 'off',
'flatTernaryExpressions': true,
'ArrayExpression': 'first',
'ObjectExpression': 'first',
}],
'eol-last': ['error', 'always'],
'semi': ['error', 'always'],
'quotes': ['warn', 'single'],
2021-11-12 01:52:10 +00:00
'comma-dangle': ['warn', 'always-multiline'],
2021-11-12 01:35:41 +00:00
'keyword-spacing': ['error', {
'before': true,
'after': true,
}],
2021-11-13 10:10:08 +00:00
'key-spacing': ['error', {
'beforeColon': false,
'afterColon': true,
}],
2021-11-12 01:35:41 +00:00
/* TODO: path alias使warn
'no-restricted-imports': ['warn', {
'patterns': [
]
}],
*/
'no-multi-spaces': ['error'],
'no-var': ['error'],
'prefer-arrow-callback': ['error'],
'no-throw-literal': ['warn'],
'no-param-reassign': ['warn'],
'no-constant-condition': ['warn'],
'no-empty-pattern': ['warn'],
'no-async-promise-executor': ['off'],
'no-useless-escape': ['off'],
'no-multi-spaces': ['warn'],
2021-11-13 10:10:08 +00:00
'no-multiple-empty-lines': ['error', { 'max': 1 }],
2021-11-12 01:35:41 +00:00
'no-control-regex': ['warn'],
'no-empty': ['warn'],
2021-11-12 01:52:10 +00:00
'no-inner-declarations': ['off'],
'no-sparse-arrays': ['off'],
2021-11-13 10:10:08 +00:00
'nonblock-statement-body-position': ['error', 'beside'],
'object-curly-spacing': ['error', 'always'],
'space-infix-ops': ['error'],
'space-before-blocks': ['error', 'always'],
2021-11-12 01:35:41 +00:00
'@typescript-eslint/no-var-requires': ['warn'],
'@typescript-eslint/no-inferrable-types': ['warn'],
'@typescript-eslint/no-empty-function': ['off'],
'@typescript-eslint/no-non-null-assertion': ['off'],
2021-11-12 01:58:13 +00:00
'@typescript-eslint/no-misused-promises': ['error', {
'checksVoidReturn': false,
}],
2021-11-12 01:35:41 +00:00
'import/no-unresolved': ['off'],
'import/no-default-export': ['warn'],
},
};