Skip to content

Commit 8d18958

Browse files
authored
fix: Remove name from eslint/js packages (#18368)
1 parent 155c71c commit 8d18958

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

packages/js/src/configs/eslint-all.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,15 @@
66

77
/* eslint quote-props: off -- autogenerated so don't lint */
88

9+
/*
10+
* IMPORTANT!
11+
*
12+
* We cannot add a "name" property to this object because it's still used in eslintrc
13+
* which doesn't support the "name" property. If we add a "name" property, it will
14+
* cause an error.
15+
*/
16+
917
module.exports = Object.freeze({
10-
"name": "@eslint/js/all",
1118
"rules": {
1219
"accessor-pairs": "error",
1320
"array-callback-return": "error",

packages/js/src/configs/eslint-recommended.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,15 @@
88

99
/* eslint sort-keys: ["error", "asc"] -- Long, so make more readable */
1010

11+
/*
12+
* IMPORTANT!
13+
*
14+
* We cannot add a "name" property to this object because it's still used in eslintrc
15+
* which doesn't support the "name" property. If we add a "name" property, it will
16+
* cause an error.
17+
*/
18+
1119
module.exports = Object.freeze({
12-
name: "@eslint/js/recommended",
1320
rules: Object.freeze({
1421
"constructor-super": "error",
1522
"for-direction": "error",

tools/update-eslint-all.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,15 @@ const code = `/*
3636
3737
/* eslint quote-props: off -- autogenerated so don't lint */
3838
39-
module.exports = Object.freeze(${JSON.stringify({ name: "@eslint/js/all", rules: allRules }, null, 4)});
39+
/*
40+
* IMPORTANT!
41+
*
42+
* We cannot add a "name" property to this object because it's still used in eslintrc
43+
* which doesn't support the "name" property. If we add a "name" property, it will
44+
* cause an error.
45+
*/
46+
47+
module.exports = Object.freeze(${JSON.stringify({ rules: allRules }, null, 4)});
4048
`;
4149

4250
fs.writeFileSync("./packages/js/src/configs/eslint-all.js", code, "utf8");

0 commit comments

Comments
 (0)