generated from chilledoj/react-ts-antd-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
76 lines (76 loc) · 2.35 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
67
68
69
70
71
72
73
74
75
76
module.exports = {
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
extends: [
'plugin:@typescript-eslint/recommended',
'airbnb',
'airbnb/hooks',
'prettier',
'prettier/@typescript-eslint',
'prettier/react',
],
parserOptions: {
ecmaVersion: 9,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
settings: {
'import/resolver': {
parcel: {
rootDir: 'src',
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
node: {
paths: ['src'],
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
},
env: {
browser: true,
es6: true,
node: true,
jest: true,
},
rules: {
quotes: ['off'], // https://github.com/prettier/eslint-config-prettier#quotes
'no-unexpected-multiline': 'off', // https://github.com/prettier/eslint-config-prettier#no-unexpected-multiline,
'arrow-parens': ['off'], // handled by prettier with rule 'arrowParens'
'react/jsx-filename-extension': [1, { extensions: ['.jsx', '.tsx'] }], // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-filename-extension.md
// https://github.com/benmosher/eslint-plugin-import/issues/1568
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
},
overrides: [
{
files: ['*.js'],
rules: {
'@typescript-eslint/no-var-requires': 'warn', // https://github.com/airbnb/javascript#modules--use-them
},
},
{
files: ['*.js', '*.jsx'],
rules: {
'@typescript-eslint/no-unused-vars': 'off', // duplicate of by no-unused-vars
'@typescript-eslint/explicit-function-return-type': 'off', // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/explicit-function-return-type.md#configuring-in-a-mixed-jsts-codebase
},
},
{
files: ['*.ts', '*.tsx'],
rules: {
'no-unused-vars': 'off', // duplicate of @typescript-eslint/no-unused-vars
'@typescript-eslint/explicit-function-return-type': ['error'], // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/explicit-function-return-type.md#configuring-in-a-mixed-jsts-codebase
},
},
],
};