-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.eslintrc.js
102 lines (102 loc) · 2.06 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/** @type {import('eslint').Linter.Config} */
module.exports = {
parser: '@babel/eslint-parser',
ignorePatterns: [
// built files
'elements/index.*',
'react/index.*',
'public/**',
// caches, etc.
'.wireit/**',
// do _not_ ignore root JS configs
'!.*.{js,mjs}',
// do _not_ ignore Storybook configs
'!.storybook'
],
plugins: [
'sfgov',
'react',
'unicorn',
'@typescript-eslint/eslint-plugin'
],
extends: [
'plugin:react/recommended',
'plugin:sfgov/recommended',
'plugin:storybook/recommended'
],
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.mjs', '.ts', '.tsx']
}
},
react: {
version: 'detect'
}
},
rules: {
'import/no-unresolved': ['error', {
ignore: [
'.*/dist/'
]
}],
'jsx-quotes': ['warn', 'prefer-single'],
'no-trailing-spaces': ['warn', {
ignoreComments: true
}],
'padding-line-between-statements': ['warn', {
blankLine: 'always',
prev: '*',
next: 'function'
}],
'react/no-unescaped-entities': ['warn'],
'react/prop-types': ['warn', {
skipUndeclared: true
}],
'unicorn/expiring-todo-comments': ['error', {
allowWarningComments: true
}]
},
reportUnusedDisableDirectives: true,
overrides: [
{
files: ['elements/src/**/*.js'],
env: {
browser: true
}
},
{
files: ['**/*.ts{,x}'],
parser: '@typescript-eslint/parser',
globals: {
JSX: true
},
// these are not needed in TypeScript
rules: {
'no-redeclare': ['off'],
'no-undef': ['off'],
'no-unused-vars': ['off'],
'import/named': ['off']
}
},
{
files: 'lib/**/*.js',
extends: ['plugin:sfgov/node'],
env: {
node: true
}
},
{
files: '**/*.mjs',
parserOptions: {
sourceType: 'module'
}
},
{
files: '**/scripts/*.{,m}js',
rules: {
'node/shebang': ['off']
}
}
]
}