-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path.eslintrc.js
107 lines (106 loc) · 2.49 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
103
104
105
106
107
const gqlSchemJson = require('./src/gqlSchema.json');
module.exports = {
env: {
browser: true,
es6: true,
node: true,
},
plugins: ['react', 'graphql', 'import', 'filenames'],
settings: {
react: {
version: '16.0',
},
},
parserOptions: {
ecmaVersion: 6,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'airbnb',
'prettier',
'prettier/react',
],
rules: {
'filenames/match-regex': ['error', '^[.a-zA-Z0-9]+$'],
'filenames/match-exported': 'error',
'graphql/template-strings': [
'error',
{
env: 'apollo',
schemaJson: gqlSchemJson,
},
],
'graphql/required-fields': [
'error',
{
env: 'apollo',
schemaJson: gqlSchemJson,
requiredFields: ['id'],
},
],
'graphql/named-operations': [
'error',
{
schemaJson: gqlSchemJson,
},
],
'graphql/capitalized-type-name': [
'error',
{
schemaJson: gqlSchemJson,
},
],
'import/default': 'error',
'import/extensions': ['error', 'never', {svg: 'always'}],
'import/first': 'error',
'import/named': 'error',
'import/namespace': 'error',
'import/no-commonjs': 'error',
'import/no-dynamic-require': 'error',
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: [
'**/*.test.js',
'src/setupTests.js',
'gql/**/*.js',
'cypress/**/*.js',
],
optionalDependencies: false,
},
],
'import/no-named-as-default-member': 'error',
'import/no-named-as-default': 'off',
'import/no-named-default': 'error',
'import/no-namespace': 'error',
'import/no-unresolved': 'error',
'import/no-webpack-loader-syntax': 'error',
'import/order': 'error',
'jsx-a11y/anchor-is-valid': [
'error',
{
components: ['Link', 'NavLink'],
specialLink: ['to'],
},
],
'no-console': 'warn',
'no-extra-bind': 'error',
'no-implicit-globals': 'error',
'no-use-before-define': 'off',
'no-underscore-dangle': 'off',
'prefer-promise-reject-errors': 'error',
'react/jsx-key': 'error',
'react/jsx-filename-extension': 'off',
'react/no-array-index-key': 'off',
'react/no-danger': 'off',
'react/no-direct-mutation-state': 'error',
'react/prop-types': 'off',
},
parser: 'babel-eslint',
root: true,
};