-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
82 lines (82 loc) · 2.4 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
module.exports = {
"env": {
"browser": true
},
'extends': [
'plugin:@wordpress/eslint-plugin/recommended-with-formatting',
'plugin:import/typescript'
],
'globals': {
'$': 'readonly',
'jQuery': 'readonly',
},
'overrides': [ {
'files': [ '**/*.ts', '**/*.tsx' ],
'plugins': [
'@typescript-eslint',
],
//Rules to override the standard JS ones when we get undesired results for TypeScript may be found here
//@link https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#supported-rules
'rules': {
'jsdoc/no-undefined-types': [ 0 ],
'no-magic-numbers': [ 0 ],
"no-redeclare": [ 0 ],
"no-shadow": [ 0 ],
'no-undef': [ 0 ],
'semi': [ 0 ],
"@typescript-eslint/no-shadow": [ "error" ],
"@typescript-eslint/no-redeclare": [ "error" ],
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/type-annotation-spacing': [ 'warn', {
before: false,
after: true,
overrides: {
arrow: {
before: true,
after: true,
},
},
} ],
},
} ],
'parser': '@typescript-eslint/parser',
'parserOptions': {
'ecmaVersion': 7,
'sourceType': 'module',
'warnOnUnsupportedTypeScriptVersion': false,
},
'rules': {
'arrow-parens': [ 1, 'as-needed' ],
'arrow-spacing': [ 1, {'before': true, 'after': true} ],
'camelcase': [ 2, {'properties': 'never'} ],
'indent': [ 1, 'tab', {'SwitchCase': 1} ],
'lines-around-comment': [ 0 ],
'jsdoc/require-param': [ 0 ],
'jsdoc/require-param-type': [ 0 ],
'jsdoc/require-returns-description': [ 0 ],
'jsdoc/check-tag-names': [ 1, {'definedTags': [ 'notice', 'link' ]} ],
'no-console': [ 0 ],
'no-multiple-empty-lines': [ 'error', {max: 2} ],
'object-curly-spacing': [ 1, 'never' ],
'react/no-unescaped-entities': [ 2, {'forbid': [ '>', '}' ]} ],
'react/display-name': [ 0 ],
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'react/jsx-curly-spacing': [ 1, {'when': 'never', 'allowMultiline': false, children: true} ],
'react/prop-types': [ 2, {'skipUndeclared': true} ],
'space-before-blocks': [ 1, 'always' ],
'space-before-function-paren': [ 'error', {
anonymous: 'never',
named: 'never',
asyncArrow: 'ignore',
} ],
'space-in-parens': [ 2, 'always' ],
'template-curly-spacing': [ 1, 'never' ],
'yoda': [ 2, 'always', {'onlyEquality': true} ],
},
'settings': {
'react': {
'version': '17.0',
},
},
};