-
Notifications
You must be signed in to change notification settings - Fork 34
/
.eslintrc.js
85 lines (85 loc) · 1.99 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
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
settings: {
react: {
pragma: 'h',
version: 'detect',
},
},
env: {
node: true,
browser: true,
es6: true,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'preact',
'prettier',
'plugin:storybook/recommended',
],
plugins: ['jest', 'prettier', 'simple-import-sort', '@typescript-eslint'],
rules: {
'no-console': ['error'],
'react/prop-types': 0,
'@typescript-eslint/default-param-last': ['error'],
'@typescript-eslint/no-explicit-any': ['off'],
'simple-import-sort/imports': [
'error',
{
groups: [
// Packages.
// Things that start with a letter (or digit or underscore), or `@` followed by a letter.
['^@?\\w'],
// Absolute imports and other imports such as Vue-style `@/foo`.
// Anything that does not start with a dot.
['^[^.]'],
// Side effect imports.
['^\\u0000'],
// Relative imports.
// Anything that starts with a dot.
['^\\.'],
],
},
],
'@typescript-eslint/no-unused-vars': [
'error',
{
vars: 'local',
varsIgnorePattern: '',
},
],
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/ban-ts-comment': [
'error',
{ 'ts-ignore': 'allow-with-description' },
],
},
overrides: [
{
files: ['*.js'],
rules: {
'@typescript-eslint/no-var-requires': 'off',
},
},
],
ignorePatterns: ['dist/', 'config/'],
plugins: ['simple-import-sort', '@typescript-eslint'],
globals: {
document: true,
window: true,
API_URL: true,
WIDGET_CONFIG_URL: true,
API_KEY: true,
SANDBOX_KEY: true,
TEST_URL: true,
},
};