@putout/eslint 3.5.0 → 3.7.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/lib/eslint.js +18 -2
- package/lib/get-eslint.mjs +1 -1
- package/package.json +7 -5
package/lib/eslint.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
const {join} = require('node:path');
|
|
3
4
|
const process = require('node:process');
|
|
4
5
|
const tryToCatch = require('try-to-catch');
|
|
5
6
|
|
|
@@ -9,12 +10,14 @@ const {isIgnored} = require('./ignore');
|
|
|
9
10
|
const {keys} = Object;
|
|
10
11
|
const eslintId = ' (eslint)';
|
|
11
12
|
|
|
12
|
-
const overrideConfigFile = process.env.ESLINT_CONFIG_FILE;
|
|
13
13
|
const noESLint = process.env.NO_ESLINT;
|
|
14
14
|
const noESLintWarnings = process.env.NO_ESLINT_WARNINGS;
|
|
15
|
+
const {ESLINT_CONFIG_FILE} = process.env;
|
|
15
16
|
|
|
16
|
-
const
|
|
17
|
+
const dir = process.cwd();
|
|
18
|
+
const overrideConfigFile = parseOverride(dir, ESLINT_CONFIG_FILE);
|
|
17
19
|
|
|
20
|
+
const NO_FLAT_CONFIG_FOUND = 'Could not find config file.';
|
|
18
21
|
const WARNING = 1;
|
|
19
22
|
|
|
20
23
|
const noConfigFound = (config, configError) => {
|
|
@@ -27,6 +30,12 @@ const noConfigFound = (config, configError) => {
|
|
|
27
30
|
if (configError)
|
|
28
31
|
return false;
|
|
29
32
|
|
|
33
|
+
if (!config)
|
|
34
|
+
return true;
|
|
35
|
+
|
|
36
|
+
if (!config.rules)
|
|
37
|
+
return true;
|
|
38
|
+
|
|
30
39
|
return !keys(config.rules).length;
|
|
31
40
|
};
|
|
32
41
|
|
|
@@ -156,3 +165,10 @@ function parseError(e) {
|
|
|
156
165
|
message: `Plugin missing: ${messageData.pluginName}`,
|
|
157
166
|
};
|
|
158
167
|
}
|
|
168
|
+
|
|
169
|
+
function parseOverride(dir, configFilePath) {
|
|
170
|
+
if (!configFilePath)
|
|
171
|
+
return configFilePath;
|
|
172
|
+
|
|
173
|
+
return join(dir, configFilePath);
|
|
174
|
+
}
|
package/lib/get-eslint.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/eslint",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.7.0",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
6
|
"description": "Wrapper that simplifies ESLint API and makes it compatible with 🐊Putout",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"repository": {
|
|
18
18
|
"type": "git",
|
|
19
|
-
"url": "git://github.com/coderaiser/putout.git"
|
|
19
|
+
"url": "git+https://github.com/coderaiser/putout.git"
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
22
22
|
"test": "madrun test",
|
|
@@ -38,11 +38,10 @@
|
|
|
38
38
|
],
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@putout/plugin-eslint-plugin": "*",
|
|
41
|
-
"c8": "^
|
|
41
|
+
"c8": "^10.0.0",
|
|
42
42
|
"eslint": "^9.0.0",
|
|
43
43
|
"eslint-plugin-n": "^17.0.0",
|
|
44
|
-
"eslint-plugin-putout": "^
|
|
45
|
-
"just-camel-case": "^4.0.2",
|
|
44
|
+
"eslint-plugin-putout": "^23.0.0",
|
|
46
45
|
"lerna": "^6.0.1",
|
|
47
46
|
"madrun": "^10.0.0",
|
|
48
47
|
"mock-require": "^3.0.3",
|
|
@@ -52,6 +51,9 @@
|
|
|
52
51
|
"supertape": "^10.0.0",
|
|
53
52
|
"try-catch": "^3.0.0"
|
|
54
53
|
},
|
|
54
|
+
"peerDependencies": {
|
|
55
|
+
"eslint": ">=8"
|
|
56
|
+
},
|
|
55
57
|
"license": "MIT",
|
|
56
58
|
"engines": {
|
|
57
59
|
"node": ">=18"
|