feat: Use defineConfig() and globalIgnores() helpers#164
Merged
mdjermanovic merged 2 commits intomainfrom Mar 14, 2025
Merged
Conversation
Member
mdjermanovic
left a comment
There was a problem hiding this comment.
When the created config doesn't have imports other than eslint/config, migration still prints out that some packages should be added (but doesn't list any):
Migrating .eslintrc.json
Wrote new config to ./eslint.config.mjs
You will need to install the following packages to use the new config:
You can install them using the following command:
npm install -D
I think the problem is that this code doesn't check whether there are any imports left after filtering out those that don't require additional installation:
rewrite/packages/migrate-config/src/migrate-config-cli.js
Lines 112 to 123 in 473c962
Member
Author
|
Fixed |
Merged
snitin315
pushed a commit
that referenced
this pull request
Mar 29, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prerequisites checklist
What is the purpose of this pull request?
Update
migrate-configto produce configs that usedefineConfig()andglobalIgnores()What changes did you make? (Give an overview)
createGlobalIgnoresfunction toCallExpressionand modified its implementation to useglobalIgnoresinstead of an object expression. (packages/migrate-config/src/migrate-config.js) [1] [2]migrateConfigObjectto push properties directly instead of mapping them into an object. (packages/migrate-config/src/migrate-config.js)defineConfigis always used by adding it to the imports and creating adefineConfigNodefor the configuration array. (packages/migrate-config/src/migrate-config.js) [1] [2] [3] [4]defineConfigandglobalIgnores. This includes changes in both CommonJS (.cjs) and ES Module (.mjs) formats. (packages/migrate-config/tests/fixtures/basic-eslintrc/expected.cjs,packages/migrate-config/tests/fixtures/basic-eslintrc/expected.mjs,packages/migrate-config/tests/fixtures/gitignore-complex/expected.cjs,packages/migrate-config/tests/fixtures/gitignore-complex/expected.mjs,packages/migrate-config/tests/fixtures/gitignore-simple/expected.cjs,packages/migrate-config/tests/fixtures/gitignore-simple/expected.mjs,packages/migrate-config/tests/fixtures/import-duplicate/expected.cjs,packages/migrate-config/tests/fixtures/import-duplicate/expected.mjs,packages/migrate-config/tests/fixtures/no-globals-for-env/expected.cjs,packages/migrate-config/tests/fixtures/no-globals-for-env/expected.mjs,packages/migrate-config/tests/fixtures/overrides-extends/expected.cjs) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27]Related Issues
fixes #163
Is there anything you'd like reviewers to focus on?