-
Notifications
You must be signed in to change notification settings - Fork 6
/
.eslintrc.js
66 lines (66 loc) · 1.54 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 = {
parser: '@typescript-eslint/parser',
plugins: ['jsx-a11y'],
extends: [
'@financial-times/eslint-config-next',
'plugin:jest/recommended',
'plugin:react/recommended',
'plugin:jsx-a11y/recommended',
'@dotcom-reliability-kit/eslint-config',
'prettier'
],
parserOptions: {
ecmaFeatures: {
jsx: true
}
},
settings: {
react: {
version: '16.8'
}
},
rules: {
// We don't expect consumers of x-dash to use prop types
'react/prop-types': 'off',
// We don't use display names for SFCs
'react/display-name': 'off',
// This rule is intended to catch < or > but it's too eager
'react/no-unescaped-entities': 'off',
// this rule is deprecated and replaced with label-has-associated-control
'jsx-a11y/label-has-for': 'off',
'jsx-a11y/label-has-associated-control': 'error'
},
overrides: [
{
// Components in x-dash interact with x-engine rather than React
files: ['components/*/src/**/*.jsx', 'components/*/__tests__/**/*.jsx'],
settings: {
react: {
pragma: 'h',
createClass: 'Component'
}
},
rules: {
'react/prefer-stateless-function': 'error'
}
},
{
files: ['*.js', '*.jsx'],
rules: {
// We are still using CommonJS imports in our JS files
'@typescript-eslint/no-var-requires': 'off'
}
},
{
files: [
'components/**/__tests__/*.js',
'components/**/__tests__/*.jsx',
'components/**/storybook/*.jsx'
],
rules: {
// We are still using CommonJS imports in our JS files
'@typescript-eslint/no-empty-function': 'off'
}
}
]
}