Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 migrate eslint config error #3571

Closed
1 task done
ouzhou opened this issue Aug 2, 2024 · 4 comments
Closed
1 task done

🐛 migrate eslint config error #3571

ouzhou opened this issue Aug 2, 2024 · 4 comments
Labels
L-JavaScript Language: JavaScript and super languages S-Needs discussion Status: needs a discussion to understand criteria

Comments

@ouzhou
Copy link

ouzhou commented Aug 2, 2024

Environment information

CLI:
  Version:                      1.8.3
  Color support:                true

Platform:
  CPU Architecture:             aarch64
  OS:                           macos

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v20.12.2"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "yarn/1.22.22"

Biome Configuration:
  Status:                       Loaded successfully
  Formatter disabled:           false
  Linter disabled:              false
  Organize imports disabled:    false
  VCS disabled:                 true

Workspace:
  Open Documents:               0

What happened?

image

run yarn biome migrate eslint --write

  ✖ Migration has encountered an error: `node` was invoked to resolve '/Users/zhouou/Desktop/work/graxy-web/node_modules/eslint-config-react-app/base.js'. This invocation failed with the following error:
    /Users/zhouou/Desktop/work/graxy-web/node_modules/@rushstack/eslint-patch/lib/modern-module-resolution.js:139
                throw new Error('Failed to patch ESLint because the calling module was not recognized.\n' +
                      ^
    
    Error: Failed to patch ESLint because the calling module was not recognized.
    If you are using a newer ESLint version that may be unsupported, please create a GitHub issue:
    https://github.com/microsoft/rushstack/issues
        at Object.<anonymous> (/Users/zhouou/Desktop/work/graxy-web/node_modules/@rushstack/eslint-patch/lib/modern-module-resolution.js:139:19)
        at Module._compile (node:internal/modules/cjs/loader:1369:14)
        at Module._extensions..js (node:internal/modules/cjs/loader:1427:10)
        at Module.load (node:internal/modules/cjs/loader:1206:32)
        at Module._load (node:internal/modules/cjs/loader:1022:12)
        at Module.require (node:internal/modules/cjs/loader:1231:19)
        at require (node:internal/modules/helpers:179:18)
        at Object.<anonymous> (/Users/zhouou/Desktop/work/graxy-web/node_modules/@rushstack/eslint-patch/modern-module-resolution.js:1:1)
        at Module._compile (node:internal/modules/cjs/loader:1369:14)
        at Module._extensions..js (node:internal/modules/cjs/loader:1427:10)
    
    Node.js v20.12.2

Expected result

success

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@ouzhou ouzhou changed the title 🐛 <TITLE> 🐛 migrate eslint config error Aug 2, 2024
@Conaclos
Copy link
Member

Conaclos commented Aug 2, 2024

The issue looks similar to #2935

Our migration tool is a best-effort approach. If the ESLint config cannot be evaluated without error, then Biome will fail to migrate the config. We have no control over that.
The best course of action is to remove the JS code that fails. See #2935 (comment) for an example.

@Conaclos Conaclos added L-JavaScript Language: JavaScript and super languages S-Needs discussion Status: needs a discussion to understand criteria labels Aug 3, 2024
@ouzhou
Copy link
Author

ouzhou commented Aug 5, 2024

Migration tools can be compatible with several scripts with high download volumes (eslint-*-config) as much as possible

A good script provides users with a better migration experience, at least considering some popular repositories

@ouzhou
Copy link
Author

ouzhou commented Aug 5, 2024

image
image

@ematipico ematipico closed this as not planned Won't fix, can't repro, duplicate, stale Aug 5, 2024
@Conaclos
Copy link
Member

Conaclos commented Aug 5, 2024

I don't see how we can improve it when the executed files are JavaScript files. I am open to suggestions to improve the migration tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L-JavaScript Language: JavaScript and super languages S-Needs discussion Status: needs a discussion to understand criteria
Projects
None yet
Development

No branches or pull requests

3 participants