-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy patheslint.config.js
67 lines (66 loc) · 1.64 KB
/
eslint.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
const eslintPluginPrettier = require('eslint-plugin-prettier');
const eslintPluginImport = require('eslint-plugin-import');
const eslintPluginTypeScript = require('@typescript-eslint/eslint-plugin');
const tsParser = require('@typescript-eslint/parser');
module.exports = [
{
files: ['**/*.ts'],
languageOptions: {
parser: tsParser,
parserOptions: {
project: './tsconfig.json',
sourceType: 'module',
ecmaVersion: 2018,
warnOnUnsupportedTypeScriptVersion: false,
ecmaFeatures: {
experimentalObjectRestSpread: true,
legacyDecorators: true,
},
},
},
plugins: {
'prettier': eslintPluginPrettier,
'import': eslintPluginImport,
'@typescript-eslint': eslintPluginTypeScript,
},
rules: {
'prettier/prettier': 'warn',
'func-call-spacing': 'off',
'jsx-quotes': ['error', 'prefer-single'],
'indent': 'off',
'no-dupe-class-members': 'error',
'no-spaced-func': 'off',
'no-unused-vars': 'off',
'no-useless-constructor': 'off',
'no-use-before-define': 'off',
'@typescript-eslint/ban-ts-comment': [
'error',
{
'ts-ignore': 'allow-with-description',
'minimumDescriptionLength': 5,
},
],
'@typescript-eslint/naming-convention': [
'error',
{
selector: ['variable'],
format: ['camelCase'],
leadingUnderscore: 'allow',
},
{
selector: 'typeLike',
format: ['PascalCase'],
},
],
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
ignoreRestSiblings: true,
},
],
'@typescript-eslint/prefer-optional-chain': 'warn',
},
},
];