eslint-plugin-putout 28.2.0 β 29.0.1
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/README.md +1 -1
- package/eslint-v10/babel.js +4 -7
- package/eslint-v10/ts.js +2 -7
- package/lib/index.mjs +2 -2
- package/lib/putout/sync/index.js +1 -3
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -177,7 +177,7 @@ Disabled π**Putout** rules:
|
|
|
177
177
|
- β [`remove-unused-variables`](https://github.com/coderaiser/putout/tree/v29.0.0/packages/plugin-remove-unused-variables#readme);
|
|
178
178
|
- β [`typescript/remove-unused-types`](https://github.com/coderaiser/putout/tree/v24.0.2/packages/plugin-typescript#remove-unused-types#readme);
|
|
179
179
|
- β [`remove-unused-expressions`](https://github.com/coderaiser/putout/tree/v29.0.0/packages/plugin-remove-unused-expressions#readme);
|
|
180
|
-
- β [`
|
|
180
|
+
- β [`variables`](https://github.com/coderaiser/putout/tree/v41.0.0/packages/plugin-variables#readme);
|
|
181
181
|
- β [`remove-useless-arguments`](https://github.com/coderaiser/putout/tree/master/packages/plugin-remove-useless-arguments#readme);
|
|
182
182
|
- β [`return/remove-useless`](https://github.com/coderaiser/putout/tree/v38.0.0/packages/plugin-return#remove-useless);
|
|
183
183
|
- β [`remove-useless-spread`](https://github.com/coderaiser/putout/tree/v29.0.0/packages/plugin-remove-useless-spread/#readme);
|
package/eslint-v10/babel.js
CHANGED
|
@@ -31,9 +31,11 @@ function addGlobals(names) {
|
|
|
31
31
|
for (const name of names) {
|
|
32
32
|
let variable = globalScope.set.get(name);
|
|
33
33
|
|
|
34
|
+
/* c8 ignore start */
|
|
34
35
|
if (variable)
|
|
35
36
|
continue;
|
|
36
37
|
|
|
38
|
+
/* c8 ignore start */
|
|
37
39
|
variable = new eslintScope.Variable(name, globalScope);
|
|
38
40
|
|
|
39
41
|
globalScope.variables.push(variable);
|
|
@@ -74,6 +76,7 @@ function addGlobals(names) {
|
|
|
74
76
|
*/
|
|
75
77
|
const {implicit} = globalScope;
|
|
76
78
|
|
|
79
|
+
/* c8 ignore start */
|
|
77
80
|
implicit.variables = implicit.variables.filter(({name}) => {
|
|
78
81
|
if (globalScope.set.has(name)) {
|
|
79
82
|
implicit.set.delete(name);
|
|
@@ -82,6 +85,7 @@ function addGlobals(names) {
|
|
|
82
85
|
|
|
83
86
|
return true;
|
|
84
87
|
});
|
|
88
|
+
/* c8 ignore end */
|
|
85
89
|
// babel-eslint's scope manager doesn't produce "implicit.left"
|
|
86
90
|
}
|
|
87
91
|
|
|
@@ -90,13 +94,6 @@ function addGlobals(names) {
|
|
|
90
94
|
//-----------------------------------------------------------------------------
|
|
91
95
|
module.exports = {
|
|
92
96
|
...babelESLintParser,
|
|
93
|
-
parse(...args) {
|
|
94
|
-
const retv = babelESLintParser.parse(...args);
|
|
95
|
-
|
|
96
|
-
retv.scopeManager.addGlobals = addGlobals;
|
|
97
|
-
|
|
98
|
-
return retv;
|
|
99
|
-
},
|
|
100
97
|
parseForESLint(...args) {
|
|
101
98
|
const retv = babelESLintParser.parseForESLint(...args);
|
|
102
99
|
|
package/eslint-v10/ts.js
CHANGED
|
@@ -73,6 +73,7 @@ function addGlobals(names) {
|
|
|
73
73
|
*/
|
|
74
74
|
const {implicit} = globalScope;
|
|
75
75
|
|
|
76
|
+
/* c8 ignore start */
|
|
76
77
|
implicit.variables = implicit.variables.filter(({name}) => {
|
|
77
78
|
if (globalScope.set.has(name)) {
|
|
78
79
|
implicit.set.delete(name);
|
|
@@ -81,6 +82,7 @@ function addGlobals(names) {
|
|
|
81
82
|
|
|
82
83
|
return true;
|
|
83
84
|
});
|
|
85
|
+
/* c8 ignore end */
|
|
84
86
|
// typescript-eslint's scope manager doesn't produce "implicit.left"
|
|
85
87
|
}
|
|
86
88
|
|
|
@@ -89,13 +91,6 @@ function addGlobals(names) {
|
|
|
89
91
|
//-----------------------------------------------------------------------------
|
|
90
92
|
module.exports = {
|
|
91
93
|
...typescriptESLintParser,
|
|
92
|
-
parse(...args) {
|
|
93
|
-
const retv = typescriptESLintParser.parse(...args);
|
|
94
|
-
|
|
95
|
-
retv.scopeManager.addGlobals = addGlobals;
|
|
96
|
-
|
|
97
|
-
return retv;
|
|
98
|
-
},
|
|
99
94
|
parseForESLint(...args) {
|
|
100
95
|
const retv = typescriptESLintParser.parseForESLint(...args);
|
|
101
96
|
|
package/lib/index.mjs
CHANGED
|
@@ -78,8 +78,8 @@ export const safeRules = {
|
|
|
78
78
|
'remove-unused-variables': 'off',
|
|
79
79
|
'remove-unused-expressions': 'off',
|
|
80
80
|
'remove-unreachable-code': 'off',
|
|
81
|
-
'
|
|
82
|
-
'
|
|
81
|
+
'arguments': 'off',
|
|
82
|
+
'variables': 'off',
|
|
83
83
|
'return/remove-useless': 'off',
|
|
84
84
|
'remove-useless-spread': 'off',
|
|
85
85
|
'remove-unreferenced-variables': 'off',
|
package/lib/putout/sync/index.js
CHANGED
|
@@ -81,9 +81,7 @@ const fix = ({ast, text, node, source, resultOptions}) => (fixer) => {
|
|
|
81
81
|
includeComments,
|
|
82
82
|
});
|
|
83
83
|
|
|
84
|
-
transform(ast, text,
|
|
85
|
-
...resultOptions,
|
|
86
|
-
});
|
|
84
|
+
transform(ast, text, resultOptions);
|
|
87
85
|
|
|
88
86
|
const [, last] = lastToken.range;
|
|
89
87
|
const code = print(ast);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-putout",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "29.0.1",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"description": "ESLint plugin for πPutout",
|
|
6
6
|
"release": false,
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"@babel/core": "^8.0.0-alpha.1",
|
|
42
42
|
"@babel/eslint-parser": "^8.0.0-alpha.1",
|
|
43
43
|
"@eslint/eslintrc": "^3.0.0",
|
|
44
|
-
"@putout/engine-parser": "^
|
|
44
|
+
"@putout/engine-parser": "^15.0.1",
|
|
45
45
|
"@putout/eslint": "^4.0.0",
|
|
46
46
|
"@putout/eslint-config": "^12.0.0",
|
|
47
47
|
"@putout/eslint-flat": "^3.0.0",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@typescript-eslint/parser": "^8.3.0",
|
|
51
51
|
"align-spaces": "^2.0.0",
|
|
52
52
|
"eslint-plugin-n": "^17.0.0",
|
|
53
|
-
"eslint-plugin-putout": "^
|
|
53
|
+
"eslint-plugin-putout": "^29.0.0",
|
|
54
54
|
"eslint-plugin-react": "^7.32.2",
|
|
55
55
|
"eslint-scope": "^9.0.0",
|
|
56
56
|
"globals": "^16.0.0",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@babel/plugin-syntax-typescript": "^8.0.0-alpha.1",
|
|
65
|
-
"@putout/plugin-eslint-plugin": "
|
|
65
|
+
"@putout/plugin-eslint-plugin": "^7.0.0",
|
|
66
66
|
"@putout/test": "^14.0.0",
|
|
67
67
|
"c8": "^10.0.0",
|
|
68
68
|
"eslint": "v10.0.0-alpha.0",
|