@gitlab/eslint-plugin 20.7.1 → 21.1.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/CHANGELOG.md +20 -0
- package/LICENSE +1 -0
- package/README.md +4 -0
- package/eslint9/lib/configs/base/best-practices.js +447 -0
- package/eslint9/lib/configs/base/errors.js +186 -0
- package/eslint9/lib/configs/base/es6.js +218 -0
- package/eslint9/lib/configs/base/imports.js +285 -0
- package/eslint9/lib/configs/base/node.js +43 -0
- package/eslint9/lib/configs/base/strict.js +6 -0
- package/eslint9/lib/configs/base/style.js +639 -0
- package/eslint9/lib/configs/base/variables.js +39 -0
- package/eslint9/lib/configs/base.js +140 -0
- package/eslint9/lib/configs/typescript.js +134 -0
- package/eslint9/lib/index.js +9 -0
- package/eslint9/package.json +78 -0
- package/lib/configs/base/best-practices.js +447 -0
- package/lib/configs/base/errors.js +186 -0
- package/lib/configs/base/es6.js +218 -0
- package/lib/configs/base/imports.js +285 -0
- package/lib/configs/base/node.js +43 -0
- package/lib/configs/base/strict.js +6 -0
- package/lib/configs/base/style.js +639 -0
- package/lib/configs/base/variables.js +39 -0
- package/lib/configs/base.js +27 -7
- package/lib/configs/default.js +1 -1
- package/lib/configs/jest.js +7 -4
- package/package.json +2 -2
package/lib/configs/base.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
const
|
|
2
|
-
'no-restricted-globals'
|
|
3
|
-
];
|
|
1
|
+
const confusingBrowserGlobals = require('confusing-browser-globals');
|
|
4
2
|
|
|
5
3
|
/*
|
|
6
4
|
This plugin contains rules related to GitLab JavaScript style guide
|
|
@@ -11,7 +9,20 @@ module.exports = {
|
|
|
11
9
|
browser: true,
|
|
12
10
|
es2020: true,
|
|
13
11
|
},
|
|
14
|
-
extends: [
|
|
12
|
+
extends: [
|
|
13
|
+
...[
|
|
14
|
+
'./base/best-practices.js',
|
|
15
|
+
'./base/errors',
|
|
16
|
+
'./base/node',
|
|
17
|
+
'./base/style',
|
|
18
|
+
'./base/variables',
|
|
19
|
+
'./base/es6',
|
|
20
|
+
'./base/imports',
|
|
21
|
+
'./base/strict',
|
|
22
|
+
].map((f) => require.resolve(f)),
|
|
23
|
+
'prettier',
|
|
24
|
+
'plugin:promise/recommended',
|
|
25
|
+
],
|
|
15
26
|
parserOptions: {
|
|
16
27
|
parser: 'espree',
|
|
17
28
|
ecmaVersion: 'latest',
|
|
@@ -71,7 +82,16 @@ module.exports = {
|
|
|
71
82
|
],
|
|
72
83
|
'no-restricted-globals': [
|
|
73
84
|
'error',
|
|
74
|
-
|
|
85
|
+
{
|
|
86
|
+
name: 'isFinite',
|
|
87
|
+
message:
|
|
88
|
+
'Use Number.isFinite instead https://github.com/airbnb/javascript#standard-library--isfinite',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: 'isNaN',
|
|
92
|
+
message:
|
|
93
|
+
'Use Number.isNaN instead https://github.com/airbnb/javascript#standard-library--isnan',
|
|
94
|
+
},
|
|
75
95
|
{
|
|
76
96
|
name: 'escape',
|
|
77
97
|
message:
|
|
@@ -82,7 +102,7 @@ module.exports = {
|
|
|
82
102
|
message:
|
|
83
103
|
"The global `unescape` function is unsafe. Did you mean to use `decodeURI`, `decodeURIComponent` or lodash's `unescape` instead?",
|
|
84
104
|
},
|
|
85
|
-
],
|
|
105
|
+
].concat(confusingBrowserGlobals),
|
|
86
106
|
'import/order': [
|
|
87
107
|
'error',
|
|
88
108
|
{
|
|
@@ -90,6 +110,6 @@ module.exports = {
|
|
|
90
110
|
},
|
|
91
111
|
],
|
|
92
112
|
// https://docs.gitlab.com/ee/development/fe_guide/style/javascript.html#limit-number-of-parameters
|
|
93
|
-
'max-params': ['error', { max: 3 }]
|
|
113
|
+
'max-params': ['error', { max: 3 }],
|
|
94
114
|
},
|
|
95
115
|
};
|
package/lib/configs/default.js
CHANGED
package/lib/configs/jest.js
CHANGED
|
@@ -9,9 +9,12 @@ module.exports = {
|
|
|
9
9
|
ignoreTypeOfDescribeName: true,
|
|
10
10
|
},
|
|
11
11
|
],
|
|
12
|
-
'jest/no-restricted-matchers': [
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
'jest/no-restricted-matchers': [
|
|
13
|
+
'error',
|
|
14
|
+
{
|
|
15
|
+
toBeFalsy: 'Prefer a stronger matcher like `toBe(false)`',
|
|
16
|
+
toBeTruthy: 'Prefer a stronger matcher like `toBe(true)`',
|
|
17
|
+
},
|
|
18
|
+
],
|
|
16
19
|
},
|
|
17
20
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitlab/eslint-plugin",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "21.1.0",
|
|
4
4
|
"description": "GitLab package for our custom eslint rules",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@typescript-eslint/eslint-plugin": "^7.14.1",
|
|
34
|
-
"
|
|
34
|
+
"confusing-browser-globals": "^1.0.11",
|
|
35
35
|
"eslint-config-prettier": "^9.1.0",
|
|
36
36
|
"eslint-plugin-import": "^2.29.1",
|
|
37
37
|
"eslint-plugin-jest": "^28.6.0",
|