Skip to content

Commit

Permalink
chore: use eslint-plugin-eslint-plugin (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjermanovic authored Nov 21, 2024
1 parent a6c0bc9 commit ede448d
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
42 changes: 42 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
//-----------------------------------------------------------------------------

import eslintConfigESLint from "eslint-config-eslint";
import eslintPlugin from "eslint-plugin-eslint-plugin";
import json from "./src/index.js";

//-----------------------------------------------------------------------------
Expand All @@ -18,6 +19,11 @@ const eslintPluginJSDoc = eslintConfigESLint.find(
config => config.plugins?.jsdoc,
).plugins.jsdoc;

const eslintPluginRulesRecommendedConfig =
eslintPlugin.configs["flat/rules-recommended"];
const eslintPluginTestsRecommendedConfig =
eslintPlugin.configs["flat/tests-recommended"];

//-----------------------------------------------------------------------------
// Configuration
//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -67,4 +73,40 @@ export default [
},
},
},
{
files: ["src/rules/*.js"],
...eslintPluginRulesRecommendedConfig,
rules: {
...eslintPluginRulesRecommendedConfig.rules,
"eslint-plugin/require-meta-schema": "off", // `schema` defaults to []
"eslint-plugin/prefer-placeholders": "error",
"eslint-plugin/prefer-replace-text": "error",
"eslint-plugin/report-message-format": ["error", "[^a-z].*\\.$"],
"eslint-plugin/require-meta-docs-description": [
"error",
{ pattern: "^(Enforce|Require|Disallow) .+[^. ]$" },
],
},
},
{
files: ["tests/rules/*.test.js"],
...eslintPluginTestsRecommendedConfig,
rules: {
...eslintPluginTestsRecommendedConfig.rules,
"eslint-plugin/test-case-property-ordering": [
"error",
[
"name",
"filename",
"code",
"output",
"language",
"options",
"languageOptions",
"errors",
],
],
"eslint-plugin/test-case-shorthand-strings": "error",
},
},
];
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"dedent": "^1.5.3",
"eslint": "^9.11.1",
"eslint-config-eslint": "^11.0.0",
"eslint-plugin-eslint-plugin": "^6.3.2",
"got": "^14.4.2",
"lint-staged": "^15.2.7",
"mocha": "^10.4.0",
Expand Down

0 comments on commit ede448d

Please sign in to comment.