@lipemat/eslint-config 3.1.2 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/helpers/config.js +1 -1
- package/index.js +46 -46
- package/package.json +3 -2
package/helpers/config.js
CHANGED
package/index.js
CHANGED
|
@@ -1,44 +1,43 @@
|
|
|
1
|
-
const {getConfig} = require( './helpers/config' );
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
2
|
* Default config if no extensions override it.
|
|
5
3
|
*
|
|
6
4
|
*/
|
|
7
|
-
let mergedConfig
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
let mergedConfig = {
|
|
6
|
+
env: {
|
|
7
|
+
browser: true,
|
|
10
8
|
},
|
|
11
|
-
|
|
9
|
+
extends: [
|
|
12
10
|
'plugin:@wordpress/eslint-plugin/recommended-with-formatting',
|
|
13
|
-
'plugin:import/typescript'
|
|
11
|
+
'plugin:import/typescript',
|
|
12
|
+
'plugin:deprecation/recommended',
|
|
14
13
|
],
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
globals: {
|
|
15
|
+
$: 'readonly',
|
|
16
|
+
jQuery: 'readonly',
|
|
18
17
|
},
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
overrides: [ {
|
|
19
|
+
files: [ '**/*.ts', '**/*.tsx' ],
|
|
20
|
+
plugins: [
|
|
22
21
|
'@typescript-eslint',
|
|
23
22
|
],
|
|
24
23
|
//Rules to override the standard JS ones when we get undesired results for TypeScript may be found here
|
|
25
|
-
//@link https://
|
|
26
|
-
|
|
24
|
+
//@link https://typescript-eslint.io/rules/
|
|
25
|
+
rules: {
|
|
27
26
|
'jsdoc/no-undefined-types': [ 0 ],
|
|
28
27
|
'no-magic-numbers': [ 0 ],
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
'no-redeclare': [ 0 ],
|
|
29
|
+
'no-shadow': [ 0 ],
|
|
31
30
|
'no-undef': [ 0 ],
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
semi: [ 0 ],
|
|
32
|
+
'@typescript-eslint/no-shadow': [ 'error' ],
|
|
33
|
+
'@typescript-eslint/no-redeclare': [ 'error' ],
|
|
35
34
|
'@typescript-eslint/no-unused-vars': 'error',
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
'@typescript-eslint/strict-boolean-expressions': [
|
|
36
|
+
'warn',
|
|
38
37
|
{
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
38
|
+
allowString: false,
|
|
39
|
+
allowNumber: false,
|
|
40
|
+
},
|
|
42
41
|
],
|
|
43
42
|
'@typescript-eslint/type-annotation-spacing': [ 'warn', {
|
|
44
43
|
before: false,
|
|
@@ -52,40 +51,40 @@ let mergedConfig = {
|
|
|
52
51
|
} ],
|
|
53
52
|
},
|
|
54
53
|
} ],
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
54
|
+
parser: '@typescript-eslint/parser',
|
|
55
|
+
parserOptions: {
|
|
56
|
+
ecmaVersion: 7,
|
|
57
|
+
project: './tsconfig.json',
|
|
58
|
+
sourceType: 'module',
|
|
59
|
+
warnOnUnsupportedTypeScriptVersion: false,
|
|
61
60
|
},
|
|
62
|
-
|
|
61
|
+
rules: {
|
|
63
62
|
'arrow-parens': [ 1, 'as-needed' ],
|
|
64
|
-
'arrow-spacing': [ 1, {
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
'arrow-spacing': [ 1, {before: true, after: true} ],
|
|
64
|
+
camelcase: [ 2, {properties: 'never'} ],
|
|
65
|
+
indent: [ 1, 'tab', {SwitchCase: 1} ],
|
|
67
66
|
'lines-around-comment': [ 0 ],
|
|
68
67
|
'jsdoc/require-param': [ 0 ],
|
|
69
68
|
'jsdoc/require-param-type': [ 0 ],
|
|
70
69
|
'jsdoc/require-returns-description': [ 0 ],
|
|
71
|
-
'jsdoc/check-tag-names': [ 1, {
|
|
70
|
+
'jsdoc/check-tag-names': [ 1, {definedTags: [ 'notice', 'link', 'task', 'ticket', 'note' ]} ],
|
|
72
71
|
|
|
73
72
|
/**
|
|
74
73
|
* Disable rule until the bug is resolved.
|
|
75
74
|
*
|
|
76
75
|
* @link https://github.com/import-js/eslint-plugin-import/issues/2267
|
|
77
76
|
*/
|
|
78
|
-
|
|
77
|
+
'import/no-unresolved': [ 0 ],
|
|
79
78
|
|
|
80
79
|
'no-console': [ 0 ],
|
|
81
80
|
'no-multiple-empty-lines': [ 'error', {max: 2} ],
|
|
82
81
|
'object-curly-spacing': [ 1, 'never' ],
|
|
83
|
-
'react/no-unescaped-entities': [ 2, {
|
|
82
|
+
'react/no-unescaped-entities': [ 2, {forbid: [ '>', '}' ]} ],
|
|
84
83
|
'react/display-name': [ 0 ],
|
|
85
84
|
'react-hooks/rules-of-hooks': 'error',
|
|
86
85
|
'react-hooks/exhaustive-deps': 'warn',
|
|
87
|
-
'react/jsx-curly-spacing': [ 1, {
|
|
88
|
-
'react/prop-types': [ 2, {
|
|
86
|
+
'react/jsx-curly-spacing': [ 1, {when: 'never', allowMultiline: false, children: true} ],
|
|
87
|
+
'react/prop-types': [ 2, {skipUndeclared: true} ],
|
|
89
88
|
'space-before-blocks': [ 1, 'always' ],
|
|
90
89
|
'space-before-function-paren': [ 'error', {
|
|
91
90
|
anonymous: 'never',
|
|
@@ -94,12 +93,12 @@ let mergedConfig = {
|
|
|
94
93
|
} ],
|
|
95
94
|
'space-in-parens': [ 2, 'always' ],
|
|
96
95
|
'template-curly-spacing': [ 1, 'never' ],
|
|
97
|
-
|
|
96
|
+
yoda: [ 2, 'always', {onlyEquality: true} ],
|
|
98
97
|
},
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
98
|
+
root: true,
|
|
99
|
+
settings: {
|
|
100
|
+
react: {
|
|
101
|
+
version: '18.0',
|
|
103
102
|
},
|
|
104
103
|
},
|
|
105
104
|
};
|
|
@@ -108,8 +107,9 @@ let mergedConfig = {
|
|
|
108
107
|
* Merge in any extensions' config.
|
|
109
108
|
*/
|
|
110
109
|
try {
|
|
110
|
+
const {getConfig} = require( './helpers/config' );
|
|
111
111
|
mergedConfig = getConfig( mergedConfig );
|
|
112
|
-
} catch( e ) {
|
|
112
|
+
} catch ( e ) {
|
|
113
113
|
// JS Boilerplate is not installed.
|
|
114
114
|
}
|
|
115
115
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lipemat/eslint-config",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Eslint configuration for all @lipemat packages",
|
|
6
6
|
"engines": {
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@wordpress/eslint-plugin": "^12.2.0",
|
|
27
|
-
"eslint": "^8"
|
|
27
|
+
"eslint": "^8",
|
|
28
|
+
"eslint-plugin-deprecation": "^2.0.0"
|
|
28
29
|
},
|
|
29
30
|
"devDependencies": {
|
|
30
31
|
"@lipemat/js-boilerplate": "^10.3.1",
|