eslint 9.39.1 → 9.39.2
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/linter/linter.js +14 -0
- package/lib/services/warning-service.js +13 -0
- package/package.json +2 -2
package/lib/linter/linter.js
CHANGED
|
@@ -1921,6 +1921,20 @@ class Linter {
|
|
|
1921
1921
|
});
|
|
1922
1922
|
}
|
|
1923
1923
|
} else {
|
|
1924
|
+
if (config.language === jslang) {
|
|
1925
|
+
for (const comment of sourceCode.getInlineConfigNodes()) {
|
|
1926
|
+
const { label } = commentParser.parseDirective(
|
|
1927
|
+
comment.value,
|
|
1928
|
+
);
|
|
1929
|
+
if (label === "eslint-env") {
|
|
1930
|
+
slots.warningService.emitESLintEnvWarning(
|
|
1931
|
+
options.filename,
|
|
1932
|
+
comment.loc.start.line,
|
|
1933
|
+
);
|
|
1934
|
+
}
|
|
1935
|
+
}
|
|
1936
|
+
}
|
|
1937
|
+
|
|
1924
1938
|
const inlineConfigResult = sourceCode.applyInlineConfig?.();
|
|
1925
1939
|
|
|
1926
1940
|
if (inlineConfigResult) {
|
|
@@ -93,6 +93,19 @@ class WarningService {
|
|
|
93
93
|
"ESLintPoorConcurrencyWarning",
|
|
94
94
|
);
|
|
95
95
|
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Emits a warning when eslint-env configuration comments are found.
|
|
99
|
+
* @param {string} filename The name of the file being linted.
|
|
100
|
+
* @param {number} line The line number of the comment.
|
|
101
|
+
* @returns {void}
|
|
102
|
+
*/
|
|
103
|
+
emitESLintEnvWarning(filename, line) {
|
|
104
|
+
this.emitWarning(
|
|
105
|
+
`/* eslint-env */ comments are no longer recognized when linting with flat config and will be reported as errors as of v10.0.0. Replace them with /* global */ comments or define globals in your config file. See https://eslint.org/docs/latest/use/configure/migration-guide#eslint-env-configuration-comments for details. Found in ${filename} at line ${line}.`,
|
|
106
|
+
"ESLintEnvWarning",
|
|
107
|
+
);
|
|
108
|
+
}
|
|
96
109
|
}
|
|
97
110
|
|
|
98
111
|
module.exports = { WarningService };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint",
|
|
3
|
-
"version": "9.39.
|
|
3
|
+
"version": "9.39.2",
|
|
4
4
|
"author": "Nicholas C. Zakas <nicholas+npm@nczconsulting.com>",
|
|
5
5
|
"description": "An AST-based pattern checker for JavaScript.",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
"@eslint/config-helpers": "^0.4.2",
|
|
113
113
|
"@eslint/core": "^0.17.0",
|
|
114
114
|
"@eslint/eslintrc": "^3.3.1",
|
|
115
|
-
"@eslint/js": "9.39.
|
|
115
|
+
"@eslint/js": "9.39.2",
|
|
116
116
|
"@eslint/plugin-kit": "^0.4.1",
|
|
117
117
|
"@humanfs/node": "^0.16.6",
|
|
118
118
|
"@humanwhocodes/module-importer": "^1.0.1",
|