forked from ava-labs/spacesvm-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
114 lines (112 loc) · 3.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
108
109
110
111
112
113
114
const fs = require('fs')
const foldersUnderSrc = fs
.readdirSync('src', { withFileTypes: true })
.filter((dirent) => dirent.isDirectory())
.map((dirent) => dirent.name)
module.exports = {
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'prettier', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
'plugin:jsx-a11y/strict',
'./.eslintrc-auto-import.json',
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
env: {
browser: true,
jasmine: true,
jest: true,
},
plugins: ['react', 'react-hooks', 'jsx-a11y', 'simple-import-sort'],
parserOptions: {
ecmaVersion: 'latest', // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
ecmaFeatures: {
jsx: true, // Allows for the parsing of JSX
},
},
rules: {
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
// e.g. "@typescript-eslint/explicit-function-return-type": "off",
'@typescript-eslint/explicit-member-accessibility': 0,
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-non-null-assertion': 0,
'@typescript-eslint/no-var-requires': 0,
'@typescript-eslint/ban-ts-comment': 0,
'@typescript-eslint/ban-types': 0,
'@typescript-eslint/camelcase': 0,
'@typescript-eslint/ban-ts-ignore': 0,
'@typescript-eslint/no-explicit-any': 0,
'no-async-promise-executor': 0,
'arrow-body-style': ['error', 'as-needed'],
'no-console': 'warn',
'no-irregular-whitespace': 0,
'react/jsx-key': 0,
'react-hooks/exhaustive-deps': 1,
'react/jsx-sort-default-props': [
'warn',
{
ignoreCase: false,
},
],
'simple-import-sort/imports': 'warn',
'simple-import-sort/exports': 'warn',
'react-hooks/rules-of-hooks': 1,
'react/prop-types': 0,
'react/display-name': 0,
'react/no-unescaped-entities': 0,
'jsx-a11y/no-autofocus': 0,
'jsx-a11y/media-has-caption': 0,
'@typescript-eslint/no-empty-function': 0,
},
settings: {
react: {
pragma: 'React',
version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use
},
'import/resolver': {
alias: {
map: [['@/*', './src/']],
extensions: ['.js', '.jsx', '.json', '.ts', '.tsx'],
},
},
},
overrides: [
{
files: ['**/*.ts', '**/*.tsx', '**/*.jsx'],
rules: {
'simple-import-sort/imports': [
'warn',
{
groups: [
// Packages. `react` related packages come first.
// Things that start with a letter (or digit or underscore), or `@` followed by a letter.
['^react', '^@?\\w'],
// Absolute imports and Relative imports.
[`^(${foldersUnderSrc.join('|')})(/.*|$)`, '^\\.'],
// for other local imports.
['^[^.]'],
],
},
],
},
},
],
globals: {
global: 'readonly',
Atomics: 'readonly',
process: true,
SharedArrayBuffer: 'readonly',
Promise: 'readonly',
Buffer: 'readonly',
WeakSet: 'readonly',
setImmediate: 'readonly',
setInterval: 'readonly',
setTimeout: 'readonly',
shallow: 'readonly',
page: 'readonly',
},
}