-
Notifications
You must be signed in to change notification settings - Fork 5
/
.eslintrc.js
58 lines (57 loc) · 1.51 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
const { getAlias } = require('./webpack/webpack.config.base');
module.exports = {
env: {
browser: true,
es2021: true,
node: true,
jest: true,
},
extends: ['plugin:react/recommended', 'airbnb', 'prettier'],
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 13,
sourceType: 'module',
},
plugins: ['react', 'prettier'],
settings: {
'import/resolver': {
alias: {
map: Object.entries(getAlias()),
extensions: ['.js', '.jsx', '.json'],
},
},
},
globals: {
__CLIENT__: 'readonly',
__SERVER__: 'readonly',
__DEV__: 'readonly',
},
rules: {
'prettier/prettier': ['error', { endOfLine: 'auto' }],
'react/jsx-filename-extension': ['warn', { extensions: ['.js', '.jsx'] }],
'react/jsx-props-no-spreading': 'off',
'react/function-component-definition': [
'error',
{ namedComponents: 'arrow-function', unnamedComponents: 'arrow-function' },
],
'import/prefer-default-export': 'off',
'import/no-import-module-exports': [
'error',
{
exceptions: ['**/src/client/index.jsx'], // only use for `module.hot` in src/client/index.jsx
},
],
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: true,
},
],
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'no-underscore-dangle': 'off',
'no-param-reassign': ['error', { props: true, ignorePropertyModificationsFor: ['state'] }],
// 'no-console': 'warn',
},
};