Skip to content

Commit f00d2af

Browse files
authored
chore: update ESLint config file to use defineConfig (#352)
* chore: update ESLint config file to use `defineConfig` * wip: use `extends` * wip: resolve comments
1 parent 0bfc8f6 commit f00d2af

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

eslint.config.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import globals from "globals";
66
import eslintConfigESLint from "eslint-config-eslint";
77
import eslintPlugin from "eslint-plugin-eslint-plugin";
88
import markdown from "./src/index.js";
9+
import { defineConfig } from "eslint/config";
910

1011
//-----------------------------------------------------------------------------
1112
// Helpers
@@ -20,8 +21,8 @@ const eslintPluginTestsRecommendedConfig =
2021
// Configuration
2122
//-----------------------------------------------------------------------------
2223

23-
export default [
24-
...eslintConfigESLint,
24+
export default defineConfig([
25+
eslintConfigESLint,
2526
{
2627
name: "markdown/js",
2728
files: ["**/*.js"],
@@ -93,9 +94,8 @@ export default [
9394
},
9495
{
9596
files: ["src/rules/*.js"],
96-
...eslintPluginRulesRecommendedConfig,
97+
extends: [eslintPluginRulesRecommendedConfig],
9798
rules: {
98-
...eslintPluginRulesRecommendedConfig.rules,
9999
"eslint-plugin/require-meta-schema": "off", // `schema` defaults to []
100100
"eslint-plugin/prefer-placeholders": "error",
101101
"eslint-plugin/prefer-replace-text": "error",
@@ -115,9 +115,8 @@ export default [
115115
},
116116
{
117117
files: ["tests/rules/*.test.js"],
118-
...eslintPluginTestsRecommendedConfig,
118+
extends: [eslintPluginTestsRecommendedConfig],
119119
rules: {
120-
...eslintPluginTestsRecommendedConfig.rules,
121120
"eslint-plugin/test-case-property-ordering": [
122121
"error",
123122
[
@@ -134,4 +133,4 @@ export default [
134133
"eslint-plugin/test-case-shorthand-strings": "error",
135134
},
136135
},
137-
];
136+
]);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
"@types/eslint": "^9.6.0",
7373
"c8": "^10.1.2",
7474
"dedent": "^1.5.3",
75-
"eslint": "^9.23.0",
75+
"eslint": "^9.25.1",
7676
"eslint-config-eslint": "^11.0.0",
7777
"eslint-plugin-eslint-plugin": "^6.3.2",
7878
"globals": "^15.1.0",

0 commit comments

Comments
 (0)