-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
82 lines (80 loc) · 2.12 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
const OFF = 0
const WARNING = 1
const ERROR = 2
module.exports = {
env: {
browser: true,
jest: true,
},
extends: [
'airbnb-typescript',
'airbnb/hooks',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
'plugin:prettier/recommended',
'prettier',
],
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: __dirname,
project: './tsconfig.json',
},
plugins: ['import', '@typescript-eslint', 'react-hooks'],
rules: {
'@typescript-eslint/camelcase': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/prefer-interface': 'off',
'@typescript-eslint/no-unused-vars': [
'error', {
argsIgnorePattern: '^_',
}
],
'no-return-assign': OFF,
'no-console': ERROR,
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: [
'**/*.setup.{js,ts}',
'**/*.config.{js,ts}',
'**/*.spec.{ts,tsx}',
'**/.storybook/**/*.{ts,tsx}',
'**/*.stories.{ts,tsx}',
'**/__fixtures__/**/*.{ts,tsx}',
],
peerDependencies: false,
},
],
'import/order': ['error', {
groups: [
'builtin',
'external',
'internal',
'index',
'sibling',
'parent',
],
'newlines-between': 'always',
}],
'import/no-named-export': OFF,
'import/newline-after-import': ERROR,
'import/named': OFF, // ref: https://github.com/benmosher/eslint-plugin-import/issues/1282
'import/prefer-default-export': OFF,
'jsx-a11y/anchor-is-valid': OFF,
'react/display-name': OFF,
'react-hooks/rules-of-hooks': 'error',
'react/jsx-filename-extension': [WARNING, { extensions: ['.tsx'] }],
'react/jsx-fragments': ['error', 'element'],
'react/jsx-props-no-spreading': OFF,
'react/prop-types': OFF,
},
settings: {
react: {
version: 'detect',
},
},
}