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