forked from Greenstand/treetracker-web-map-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
103 lines (92 loc) · 2.38 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
module.exports = {
extends: [
'airbnb',
'next',
'plugin:react/jsx-runtime',
'plugin:cypress/recommended',
'prettier',
],
rules: {
// project specific
camelcase: 'off',
'no-unused-expressions': ['error', { allowShortCircuit: true }],
'react/jsx-filename-extension': ['error', { extensions: ['.js'] }],
// async functions must use 'await'
'require-await': 'error',
// disabled because too strict
'react/jsx-props-no-spreading': 'off',
'react/jsx-no-bind': 'off',
'react/prop-types': ['error', { skipUndeclared: true }],
// allow test files to use dev dependencies
'import/no-extraneous-dependencies': [
'warn',
{
devDependencies: [
'**/*.{test,cy,spec}.js',
'cypress/**/*',
'.jest/**/*',
'**/test-utils.js',
'src/mocks/*',
],
},
],
// import sorting
'import/order': [
'error',
{
groups: [
'builtin', // node built in
'external', // installed dependencies
'internal', // baseUrl
'index', // ./
'sibling', // ./*
'parent', // ../*
],
alphabetize: {
order: 'asc',
caseInsensitive: false,
},
'newlines-between': 'never',
},
],
// rule triggers false positive
'@next/next/no-page-custom-font': 'off',
// should be set to error when warnings are cleared
'import/prefer-default-export': 'warn',
'jsx-a11y/anchor-is-valid': 'warn',
'jsx-a11y/click-events-have-key-events': 'warn',
'jsx-a11y/no-static-element-interactions': 'warn',
'jsx-a11y/alt-text': 'warn',
'@next/next/no-img-element': 'warn',
'react-hooks/exhaustive-deps': 'warn',
'no-unused-vars': 'warn',
'no-nested-ternary': 'warn',
'prefer-destructuring': 'warn',
'no-unreachable': 'warn',
'cypress/unsafe-to-chain-command': 'warn',
'import/no-extraneous-dependencies': 'warn',
'global-require': 'warn',
'import/extensions': 'warn',
'no-dupe-keys': 'warn',
},
reportUnusedDisableDirectives: true,
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 12,
sourceType: 'module',
},
settings: {
'import/resolver': {
node: {
paths: ['src'],
},
},
},
env: {
browser: true,
es2021: true,
jest: true,
},
};