89 lines
3 KiB
JavaScript
89 lines
3 KiB
JavaScript
|
module.exports = {
|
||
|
root: true,
|
||
|
extends: [
|
||
|
'eslint:recommended',
|
||
|
],
|
||
|
parserOptions: {
|
||
|
'ecmaVersion': 2017,
|
||
|
},
|
||
|
env: {
|
||
|
'node': true,
|
||
|
'es6': true,
|
||
|
},
|
||
|
rules: {
|
||
|
'camelcase': ['error', {
|
||
|
'properties': 'always',
|
||
|
'ignoreDestructuring': false,
|
||
|
'ignoreImports': false,
|
||
|
}],
|
||
|
// 'capitalized-comments': ['error', 'always'],
|
||
|
'comma-dangle': ['error', 'always-multiline'],
|
||
|
'comma-spacing': ['error', { 'before': false, 'after': true }],
|
||
|
'curly': ['error', 'all'],
|
||
|
'eol-last': ['error', 'never'],
|
||
|
'indent': ['error', 4],
|
||
|
'key-spacing': ['error', {
|
||
|
'beforeColon': false,
|
||
|
'afterColon': true,
|
||
|
'mode': 'strict',
|
||
|
}],
|
||
|
'keyword-spacing': ['error', {
|
||
|
'after': true,
|
||
|
'overrides': {
|
||
|
'if': { 'after': false },
|
||
|
'for': { 'after': false },
|
||
|
'while': { 'after': false },
|
||
|
},
|
||
|
}],
|
||
|
'max-classes-per-file': ['error', 1],
|
||
|
'max-len': ['error', 150],
|
||
|
'no-console': ['warn'],
|
||
|
'no-empty': ['error', { 'allowEmptyCatch': false }],
|
||
|
'no-multi-spaces': ['error', { 'ignoreEOLComments': false }],
|
||
|
'no-trailing-spaces': ['error', { 'ignoreComments': false }],
|
||
|
'no-warning-comments': ['warn', { 'location': 'start' }],
|
||
|
'object-curly-spacing': ['error', 'always'],
|
||
|
'quotes': ['error', 'single'],
|
||
|
'semi': ['error', 'always'],
|
||
|
'sort-imports': ['error', {
|
||
|
'ignoreCase': false,
|
||
|
'ignoreDeclarationSort': false,
|
||
|
'ignoreMemberSort': false,
|
||
|
'memberSyntaxSortOrder': ['none', 'all', 'multiple', 'single']
|
||
|
}],
|
||
|
'sort-vars': ['error', { 'ignoreCase': true }],
|
||
|
'space-before-blocks': ['error', 'always'],
|
||
|
'space-before-function-paren': ['error', {
|
||
|
'anonymous': 'always',
|
||
|
'named': 'never',
|
||
|
'asyncArrow': 'always'
|
||
|
}],
|
||
|
'space-in-parens': ['error', 'never'],
|
||
|
'spaced-comment': ['error', 'always'],
|
||
|
},
|
||
|
overrides: [
|
||
|
{
|
||
|
files: ['*.ts'],
|
||
|
parser: '@typescript-eslint/parser',
|
||
|
parserOptions: {
|
||
|
project: 'tsconfig.json',
|
||
|
},
|
||
|
plugins: [
|
||
|
'@typescript-eslint',
|
||
|
],
|
||
|
extends: [
|
||
|
'plugin:@typescript-eslint/eslint-recommended',
|
||
|
'plugin:@typescript-eslint/recommended',
|
||
|
],
|
||
|
rules: {
|
||
|
'@typescript-eslint/array-type': ['error', {
|
||
|
'default': 'array',
|
||
|
'readonly': 'array-simple',
|
||
|
}],
|
||
|
'@typescript-eslint/interface-name-prefix': ['error', 'always'],
|
||
|
'@typescript-eslint/no-empty-interface': ['error', { 'allowSingleExtends': false }],
|
||
|
'@typescript-eslint/type-annotation-spacing': ['error', { 'before': false, 'after': true }],
|
||
|
}
|
||
|
}
|
||
|
],
|
||
|
};
|