-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
101 lines (100 loc) · 2.25 KB
/
index.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
const tsRules = require('./rules/typescript').rules
module.exports = {
extends: [
'airbnb-base',
'./rules/best-practices.js',
'./rules/errors.js',
'./rules/imports.js',
'./rules/react.js',
'./rules/react-hooks.js',
'./rules/es6.js',
'./rules/style.js',
'./rules/variables.js',
'./rules/prettier.js',
],
env: {
browser: true,
node: true,
jest: true,
es2020: true,
},
globals: {
_: true,
},
parser: '@babel/eslint-parser',
parserOptions: {
parser: '@babel/eslint-parser',
requireConfigFile: false,
ecmaVersion: 2020,
ecmaFeatures: {
impliedStrict: true,
jsx: true,
},
babelOptions: {
babelrc: false,
configFile: false,
presets: ['@babel/preset-env', '@babel/preset-react'],
},
},
rules: {},
overrides: [
{
files: ['*.test.js', '*.spec.js'],
rules: {
'global-require': 'off',
'no-magic-numbers': 'off',
},
},
{
files: ['.storybook/**/*.js'],
rules: {
'global-require': 'off',
},
},
{
files: ['./src/index.js', 'types.js'],
rules: {
'import/no-unused-modules': 'off',
},
},
{
files: ['src/**/*.tsx', 'src/**/*.ts', '**/*.d.ts'],
parser: '@typescript-eslint/parser',
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx', '.d.ts'],
},
react: {
version: 'detect',
},
'import/resolver': {
typescript: {},
},
},
plugins: ['@typescript-eslint'],
extends: [
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:import/typescript',
],
rules: tsRules,
parserOptions: {
ecmaFeatures: {
experimentalObjectRestSpread: true,
jsx: true,
},
project: './tsconfig.json',
tsconfigRootDir: process.cwd(),
},
},
{
files: ['**/*.d.ts'],
rules: {
'react/prefer-stateless-function': 'off',
'import/no-unused-modules': 'off',
'import/extensions': 'off',
},
},
],
}