-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
64 lines (64 loc) · 1.79 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
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 6,
sourceType: 'module',
ecmaFeatures: {
modules: true,
},
},
extends: [
// Typescript recommended settings disabled for now - too many errors!
// 'plugin:@typescript-eslint/recommended',
'airbnb-base',
// 'react-app',
// Prettier config disables any formatting rules
'prettier/@typescript-eslint',
'plugin:react/recommended',
'plugin:prettier/recommended',
// 'plugin:css-modules/recommended',
],
plugins: ['@typescript-eslint', 'react'],
rules: {
// Next JS has a Link component that wraps around <a></a>, inserting the href during compilation. Disable for now.
'jsx-a11y/anchor-is-valid': 0,
// Disable JS no-unused-vars and enable TS no-unused-vars, otherwise there is confusion.
'no-unused-vars': 0,
'react/prop-types': 0,
'@typescript-eslint/no-unused-vars': 'error',
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
'no-console': 0,
'import/extensions': 0,
'import/prefer-default-export': 0,
'class-methods-use-this': [
'error',
{
exceptMethods: [
'render',
'getInitialState',
'getDefaultProps',
'getChildContext',
'componentWillMount',
'componentDidMount',
'componentWillReceiveProps',
'shouldComponentUpdate',
'componentWillUpdate',
'componentDidUpdate',
'componentWillUnmount',
],
},
],
'linebreak-style': 0,
},
settings: {
// Enable Typescript imports to be recognised
'import/resolver': {
node: {
extensions: ['.mjs', '.js', '.json', '.ts', '.tsx'],
},
},
react: {
version: 'detect',
},
},
};