-
Notifications
You must be signed in to change notification settings - Fork 5
/
.eslintrc.js
74 lines (74 loc) · 2.27 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
const path = require('path')
module.exports = {
extends: ['airbnb', 'prettier', 'prettier/react'],
plugins: ['prettier', 'import', 'jsx-a11y', 'react', 'react-hooks', 'json', 'html'],
env: {
browser: true,
},
parser: 'babel-eslint',
rules: {
// This rule wants you to write fragments as
// <><Foo /></> instead of <Fragment><Foo /></Fragment>
// This makes the code harder to understand with no benefit
'react/jsx-fragments': 0,
// We have plenty of utility classes that should't use default export
// right now the project is rather empty resulting in this rule flagging
// incorrectly regularly.
'import/prefer-default-export': 0,
// Aim of this rule is to ensure you have support for users with disabilities
// This is out of scope for now, and should be a bigger conversation to ensure
// propert support in the whole application
'jsx-a11y/click-events-have-key-events': 0,
'class-methods-use-this': 0,
// his linting rule adds no stylistic or performance value.
'react/state-in-constructor': 0,
'no-plusplus': 0,
// This is lines up with how linting is configured in our other project
'react/static-property-placement': ['error', 'static public field'],
'react/jsx-filename-extension': [
'error',
{
extensions: ['.js', '.jsx'],
},
],
'react/jsx-props-no-spreading': 'off',
'react/jsx-wrap-multilines': [
'error',
{
arrow: false,
},
],
'react/prop-types': 0,
'prettier/prettier': [
'error',
{
printWidth: 80,
singleQuote: true,
semi: false,
trailingComma: 'es5',
bracketSpacing: true,
jsxBracketSameLine: false,
parser: 'babel',
},
],
'jsx-a11y/anchor-is-valid': [
'error',
{
components: ['Link'],
specialLink: ['hrefLeft', 'hrefRight'],
aspects: ['noHref', 'invalidHref', 'preferButton'],
},
],
'no-use-before-define': [
'error',
{
functions: false,
classes: true,
variables: false,
},
],
'import/no-extraneous-dependencies': ['error', { devDependencies: ['**/*.stories.js'] }],
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
},
}