-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.js
More file actions
95 lines (94 loc) · 2.31 KB
/
eslint.config.js
File metadata and controls
95 lines (94 loc) · 2.31 KB
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
const js = require('@eslint/js')
const react = require('eslint-plugin-react')
const reactHooks = require('eslint-plugin-react-hooks')
const jsxA11y = require('eslint-plugin-jsx-a11y')
const babelParser = require('@babel/eslint-parser')
module.exports = [
js.configs.recommended,
{
files: ['**/*.{js,jsx,ts,tsx}'],
plugins: {
react,
'react-hooks': reactHooks,
'jsx-a11y': jsxA11y,
},
languageOptions: {
parser: babelParser,
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
globals: {
__PATH_PREFIX__: 'readonly',
browser: true,
node: true,
es6: true,
process: 'readonly',
require: 'readonly',
module: 'readonly',
__dirname: 'readonly',
exports: 'readonly',
console: 'readonly',
setTimeout: 'readonly',
clearTimeout: 'readonly',
setInterval: 'readonly',
clearInterval: 'readonly',
Promise: 'readonly',
Buffer: 'readonly',
global: 'readonly',
window: 'readonly',
document: 'readonly',
navigator: 'readonly',
fetch: 'readonly',
localStorage: 'readonly',
sessionStorage: 'readonly',
HTMLElement: 'readonly',
Event: 'readonly',
},
},
settings: {
react: {
version: 'detect',
},
},
rules: {
'react/prop-types': 'off',
'react/display-name': 'off',
'jsx-a11y/anchor-is-valid': [
'error',
{
components: ['Link'],
specialLink: ['to'],
},
],
'no-console': ['warn', { allow: ['warn', 'error'] }],
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',
...react.configs.recommended.rules,
...reactHooks.configs.recommended.rules,
...jsxA11y.configs.recommended.rules,
},
},
{
ignores: [
'node_modules/',
'.cache/',
'public/',
'static/',
'build/',
'*.min.js',
'gatsby-browser.js',
'gatsby-node.js',
'gatsby-ssr.js',
'gatsby-config.js',
'jest.setup.js',
'jest.config.js',
'.babelrc',
'__mocks__/**',
],
},
]