forked from contentful/forma-36
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
103 lines (103 loc) · 2.95 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 = {
parser: '@typescript-eslint/parser',
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'prettier/@typescript-eslint',
'plugin:react/recommended',
'plugin:jsx-a11y/recommended',
'prettier/react',
'plugin:jest/recommended',
'plugin:jest/style',
],
plugins: ['import', 'react-hooks', 'jest-dom', 'testing-library'],
parserOptions: {
ecmaVersion: 7,
project: './tsconfig.json',
sourceType: 'module',
},
env: {
jest: true,
browser: true,
node: true,
},
settings: {
react: {
version: 'detect',
},
},
rules: {
'react/prop-types': 'off',
'react/prefer-stateless-function': ['off', { ignorePureComponents: true }],
'react/jsx-filename-extension': ['off', { extensions: ['.js', '.tsx'] }],
'react/forbid-prop-types': 'off',
'react/destructuring-assignment': 'off',
'react/jsx-one-expression-per-line': 'off',
'react/sort-comp': 'off',
'react/jsx-wrap-multilines': 'off',
'function-paren-newline': 'off',
'react/button-has-type': 'error',
'react/jsx-no-target-blank': 'error',
'react/jsx-no-bind': ['error', { allowArrowFunctions: true }],
'react/no-access-state-in-setstate': 'error',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-member-accessibility': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/ban-types': 'off',
'react/react-in-jsx-scope': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
vars: 'all',
args: 'after-used',
ignoreRestSiblings: true,
},
],
'@typescript-eslint/no-for-in-array': 'error',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-non-null-assertion': 'error',
'@typescript-eslint/no-empty-function': 'off',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'import/named': 'error',
'import/no-default-export': 'error',
},
overrides: [
{
files: ['**/*.stories.*'],
rules: {
'@typescript-eslint/no-object-literal-type-assertion': 'off',
'import/no-default-export': 'off',
},
},
{
files: ['**/*.js', '**/*.jsx'],
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 7,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
env: {
node: true,
browser: true,
},
},
{
files: [
'**/forma-36-website/**/*',
'**/forma-36-react-components/tools/**/*',
'**/forma-36-react-components/**/Icon/svg/*',
'**/forma-36-react-components/**/ProductIcon/**/*',
'**/forma-36-react-components/**/Illustration/**/*',
'**/packages/components/**/*',
],
rules: {
'import/no-default-export': 'off',
},
},
],
};