-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Wrap plugins that are wrapped in extends (#37)
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
- Loading branch information
1 parent
934f010
commit 6c73ed2
Showing
11 changed files
with
116 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 5 additions & 6 deletions
11
packages/migrate-config/tests/fixtures/basic-eslintrc/expected.cjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/migrate-config/tests/fixtures/basic-eslintrc/expected.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 5 additions & 6 deletions
11
packages/migrate-config/tests/fixtures/no-globals-for-env/expected.cjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/migrate-config/tests/fixtures/no-globals-for-env/expected.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
packages/migrate-config/tests/fixtures/plugins-dedupe/.eslintrc.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
root: true | ||
plugins: | ||
- import | ||
- n | ||
extends: | ||
- plugin:import/errors | ||
- plugin:n/recommended |
28 changes: 28 additions & 0 deletions
28
packages/migrate-config/tests/fixtures/plugins-dedupe/expected.cjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const { | ||
fixupConfigRules, | ||
fixupPluginRules, | ||
} = require("@eslint/compat"); | ||
|
||
const _import = require("eslint-plugin-import"); | ||
const n = require("eslint-plugin-n"); | ||
const js = require("@eslint/js"); | ||
|
||
const { | ||
FlatCompat, | ||
} = require("@eslint/eslintrc"); | ||
|
||
const compat = new FlatCompat({ | ||
baseDirectory: __dirname, | ||
recommendedConfig: js.configs.recommended, | ||
allConfig: js.configs.all | ||
}); | ||
|
||
module.exports = [ | ||
...fixupConfigRules(compat.extends("plugin:import/errors", "plugin:n/recommended")), | ||
{ | ||
plugins: { | ||
import: fixupPluginRules(_import), | ||
n: fixupPluginRules(n), | ||
}, | ||
}, | ||
]; |
26 changes: 26 additions & 0 deletions
26
packages/migrate-config/tests/fixtures/plugins-dedupe/expected.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { fixupConfigRules, fixupPluginRules } from "@eslint/compat"; | ||
import _import from "eslint-plugin-import"; | ||
import n from "eslint-plugin-n"; | ||
import path from "node:path"; | ||
import { fileURLToPath } from "node:url"; | ||
import js from "@eslint/js"; | ||
import { FlatCompat } from "@eslint/eslintrc"; | ||
const __filename = fileURLToPath(import.meta.url); | ||
const __dirname = path.dirname(__filename); | ||
|
||
|
||
const compat = new FlatCompat({ | ||
baseDirectory: __dirname, | ||
recommendedConfig: js.configs.recommended, | ||
allConfig: js.configs.all | ||
}); | ||
|
||
export default [ | ||
...fixupConfigRules(compat.extends("plugin:import/errors", "plugin:n/recommended")), | ||
{ | ||
plugins: { | ||
import: fixupPluginRules(_import), | ||
n: fixupPluginRules(n), | ||
}, | ||
}, | ||
]; |
7 changes: 3 additions & 4 deletions
7
packages/migrate-config/tests/fixtures/release-it/expected.cjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters