-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: skip add plugin when already imported (#70)
- Loading branch information
Showing
5 changed files
with
44 additions
and
1 deletion.
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
8 changes: 8 additions & 0 deletions
8
packages/migrate-config/tests/fixtures/import-duplicate/.eslintrc.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,8 @@ | ||
module.exports = { | ||
plugins: ["react"], | ||
overrides: [ | ||
{ | ||
plugins: ["react-hooks"], | ||
} | ||
] | ||
}; |
17 changes: 17 additions & 0 deletions
17
packages/migrate-config/tests/fixtures/import-duplicate/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,17 @@ | ||
const react = require("eslint-plugin-react"); | ||
|
||
const { | ||
fixupPluginRules, | ||
} = require("@eslint/compat"); | ||
|
||
const reactHooks = require("eslint-plugin-react-hooks"); | ||
|
||
module.exports = [{ | ||
plugins: { | ||
react: fixupPluginRules(react), | ||
}, | ||
}, { | ||
plugins: { | ||
"react-hooks": fixupPluginRules(reactHooks), | ||
}, | ||
}]; |
13 changes: 13 additions & 0 deletions
13
packages/migrate-config/tests/fixtures/import-duplicate/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,13 @@ | ||
import react from "eslint-plugin-react"; | ||
import { fixupPluginRules } from "@eslint/compat"; | ||
import reactHooks from "eslint-plugin-react-hooks"; | ||
|
||
export default [{ | ||
plugins: { | ||
react: fixupPluginRules(react), | ||
}, | ||
}, { | ||
plugins: { | ||
"react-hooks": fixupPluginRules(reactHooks), | ||
}, | ||
}]; |
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