This repository has been archived by the owner on Nov 8, 2024. It is now read-only.
forked from pluralsight/classic-design-system
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
116 lines (114 loc) · 3.25 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
115
116
const IGNORE = 0
const WARNING = 1
const ERROR = 2
module.exports = {
root: true,
env: {
browser: true,
es6: true,
jest: true
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true
},
sourceType: 'module',
project: './tsconfig.json',
createDefaultProgram: true
},
settings: {
'import/cache': { lifetime: Infinity },
'import/internal-regex': '^@pluralsight/',
react: { version: 'detect' }
},
extends: [
'standard',
'standard-react',
'eslint:recommended',
'plugin:import/typescript',
'plugin:jest/recommended',
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'prettier/standard',
'prettier/react',
'prettier/@typescript-eslint',
// NOTE: this must be the last item in the array
'plugin:prettier/recommended'
],
plugins: [
'@typescript-eslint',
'import',
'jest',
'react',
'react-hooks',
'prettier'
],
rules: {
'import/extensions': [WARNING, 'always', { ignorePackages: true }],
'import/no-cycle': ERROR,
'@typescript-eslint/ban-ts-comment': [
ERROR,
{
'ts-ignore': 'allow-with-description'
}
],
'@typescript-eslint/explicit-function-return-type': IGNORE,
'@typescript-eslint/explicit-module-boundary-types': IGNORE,
'@typescript-eslint/interface-name-prefix': IGNORE,
'@typescript-eslint/no-empty-function': WARNING,
'@typescript-eslint/no-empty-interface': IGNORE,
'@typescript-eslint/no-non-null-assertion': IGNORE,
'@typescript-eslint/no-this-alias': WARNING,
'@typescript-eslint/no-unsafe-assignment': IGNORE,
'@typescript-eslint/no-unsafe-call': IGNORE,
'@typescript-eslint/no-unsafe-member-access': IGNORE,
'@typescript-eslint/no-unsafe-return': IGNORE,
'@typescript-eslint/no-use-before-define': [
ERROR,
{ classes: false, functions: false, variables: false }
],
'@typescript-eslint/no-extra-semi': IGNORE,
'@typescript-eslint/no-floating-promises': IGNORE,
'@typescript-eslint/no-unused-vars': [WARNING, { argsIgnorePattern: '^_' }],
'@typescript-eslint/no-var-requires': IGNORE,
'@typescript-eslint/require-await': IGNORE,
'@typescript-eslint/prefer-regexp-exec': IGNORE,
'@typescript-eslint/restrict-plus-operands': WARNING,
'@typescript-eslint/restrict-template-expressions': WARNING,
'@typescript-eslint/unbound-method': WARNING,
'no-unused-expressions': IGNORE,
'no-use-before-define': IGNORE,
'prettier/prettier': ERROR,
'react-hooks/exhaustive-deps': WARNING,
'react-hooks/rules-of-hooks': ERROR,
'react/display-name': IGNORE,
'react/jsx-no-bind': IGNORE,
'react/jsx-pascal-case': IGNORE,
'react/no-unescaped-entities': WARNING,
'react/prop-types': IGNORE
},
overrides: [
{
files: ['**/__stories__/*.js'],
rules: {
'react/jsx-key': IGNORE
}
},
{
files: ['*.ts', '*.tsx'],
rules: {
'import/extensions': IGNORE,
'react/display-name': IGNORE,
'react/prop-types': IGNORE
}
},
{
files: ['*.json'],
rules: {
'no-unused-expressions': IGNORE
}
}
]
}