-
Notifications
You must be signed in to change notification settings - Fork 4
/
.eslintrc.js
66 lines (66 loc) · 2.37 KB
/
.eslintrc.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
module.exports = {
env: {
browser: true,
es6: true,
},
extends: ['eslint-config-ali/typescript/react', 'prettier', 'prettier/@typescript-eslint', 'prettier/react'],
parser: '@typescript-eslint/parser',
plugins: ['markdown'],
parserOptions: {
ecmaVersion: 2020, // specify the version of ECMAScript syntax you want to use: 2015 => (ES6)
sourceType: 'module', // Allows for the use of imports
ecmaFeatures: {
jsx: true, // enable JSX
impliedStrict: true, // enable global strict mode
},
project: ['./tsconfig.json'], // Specify it only for TypeScript files
tsconfigRootDir: __dirname,
},
rules: {
'no-param-reassign': ['error', { props: true, ignorePropertyModificationsFor: ['draft', 'state', 'acc'] }],
'import/prefer-default-export': 'off',
// 'react/jsx-filename-extension': [2, { 'extensions': ['.js', '.jsx', '.ts', '.tsx'] }],
'react/prop-types': 'off',
'arrow-body-style': 'off',
'max-len': 'off',
'no-nested-ternary': 'off',
'react/no-multi-comp': 'off',
'jsx-first-prop-new-line': 'off',
'no-unused-vars': 'off',
'import/no-named-as-default': 'off',
'import/no-named-as-default-member': 'off',
'react-hooks/rules-of-hooks': 'error',
'no-console': 2,
'@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': [1, { argsIgnorePattern: '^_', varsIgnorePattern: '^ignored?$' }],
'@typescript-eslint/interface-name-prefix': 'off',
indent: 0,
'react/jsx-no-undef': 0,
'@typescript-eslint/consistent-type-assertions': [0, { objectLiteralTypeAssertions: 'allow-as-parameter' }],
'import/no-anonymous-default-export': 1,
},
overrides: [
{
files: ['**/*.js'], // none ts script like webpack config or legacy node scripts
rules: {
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-require-imports': 'off',
'no-console': 'off',
},
},
{
files: ['./docs/**/*.md'], // none ts script like webpack config or legacy node scripts
processor: 'markdown/markdown',
},
{
files: ['./docs/**/*.tsx'],
rules: {
'no-console': 'off',
'import/no-anonymous-default-export': 'off',
'no-param-reassign': 'off',
},
},
],
};