Skip to content

Commit

Permalink
chore: make internal-rules not being a package (eslint#18601)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjermanovic authored Jun 18, 2024
1 parent 3379164 commit c7ddee0
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 20 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jsdoc/
.eslintcache
.cache
/packages/**/node_modules
/tools/internal-rules/node_modules
/.vscode
.sublimelinterrc
.eslint-release-info.json
Expand Down
3 changes: 1 addition & 2 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
//-----------------------------------------------------------------------------

const path = require("node:path");
const internalPlugin = require("eslint-plugin-internal-rules");
const internalPlugin = require("./tools/internal-rules");
const eslintPluginRulesRecommendedConfig = require("eslint-plugin-eslint-plugin/configs/rules-recommended");
const eslintPluginTestsRecommendedConfig = require("eslint-plugin-eslint-plugin/configs/tests-recommended");
const globals = require("globals");
Expand Down Expand Up @@ -74,7 +74,6 @@ module.exports = [
"tests/fixtures/**",
"tests/performance/**",
"tmp/**",
"tools/internal-rules/node_modules/**",
"**/test.js"
]
},
Expand Down
7 changes: 3 additions & 4 deletions knip.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"workspaces": {
".": {
// These entries are complementary to the ones found in package.json
"entry": ["lib/rules/index.js", "tools/internal-rules/index.js"],
"entry": ["lib/rules/index.js", "tools/internal-rules/*.js"],
"project": ["{conf,lib,tools}/**/*.js"],
"mocha": {
"entry": [
Expand All @@ -27,9 +27,8 @@
"@wdio/cli",
"rollup-plugin-node-polyfills",

// FIXME: not sure why is eslint-config-eslint, eslint-plugin-internal-rules reported as unused
"eslint-config-eslint",
"eslint-plugin-internal-rules"
// FIXME: not sure why is eslint-config-eslint reported as unused
"eslint-config-eslint"
]
},
"docs": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@
"eslint": "file:.",
"eslint-config-eslint": "file:packages/eslint-config-eslint",
"eslint-plugin-eslint-plugin": "^6.0.0",
"eslint-plugin-internal-rules": "file:tools/internal-rules",
"eslint-release": "^3.2.2",
"eslint-rule-composer": "^0.3.0",
"eslump": "^3.0.0",
"esprima": "^4.0.1",
"fast-glob": "^3.2.11",
Expand Down
6 changes: 3 additions & 3 deletions tests/lib/cli-engine/cli-engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -5191,17 +5191,17 @@ describe("CLIEngine", () => {
});

it("should expose the list of plugin rules", () => {
const engine = new CLIEngine({ plugins: ["internal-rules"] });
const engine = new CLIEngine({ plugins: ["eslint-plugin-eslint-plugin"] });

assert(engine.getRules().has("internal-rules/no-invalid-meta"), "internal-rules/no-invalid-meta is present");
assert(engine.getRules().has("eslint-plugin/require-meta-schema"), "eslint-plugin/require-meta-schema is present");
});

it("should expose the list of rules from a preloaded plugin", () => {
const engine = new CLIEngine({
plugins: ["foo"]
}, {
preloadedPlugins: {
foo: require("eslint-plugin-internal-rules")
foo: require("../../../tools/internal-rules")
}
});

Expand Down
9 changes: 0 additions & 9 deletions tools/internal-rules/package.json

This file was deleted.

0 comments on commit c7ddee0

Please sign in to comment.