Skip to content

rakleed/eslint-react-oxc-migration

Repository files navigation

Latest issue: oxc-project/oxc#19971

Original issue: oxc-project/oxlint-migrate#377

Steps to reproduce

  1. Init React project: https://vite.dev/guide/#scaffolding-your-first-vite-project

    npm create vite@latest eslint-react-oxc-migration -- --template react
  2. Add "overrides": { "eslint": "^10.0.2" } to package.json to remove compatability warnings due to eslint-plugin-react-hooks.

  3. Update all dependencies to latest version:

    npx npm-check-updates -y
  4. Add @eslint-react/eslint-plugin package: https://www.eslint-react.xyz/docs/getting-started/javascript

    npm install --save-dev globals eslint @eslint/js @eslint-react/eslint-plugin
  5. Add eslintReact.configs.recommended to eslint config:

    import eslintReact from "@eslint-react/eslint-plugin"
    
    extends: [..., eslintReact.configs.recommended]
  6. Run migration tool:

    npx @oxlint/migrate --js-plugins --details
  7. Run oxlint:

    npx oxlint .

Actual behavior

> npx oxlint .

  × Error running JS plugin.
  │ File path: /Users/rakleed/Developer/eslint-react-oxc-migration/src/main.jsx
  │ Error: `context.markVariableAsUsed` not implemented yet
  │     at Object.markVariableAsUsed (file:///Users/rakleed/Developer/eslint-react-oxc-migration/node_modules/oxlint/dist/lint.js:11968:8)
  │     at JSXOpeningElement (file:///Users/rakleed/Developer/eslint-react-oxc-migration/node_modules/eslint-plugin-react-x/dist/index.js:606:24)
  │     at file:///Users/rakleed/Developer/eslint-react-oxc-migration/node_modules/oxlint/dist/lint.js:19760:17
  │     at walkJSXOpeningElement (file:///Users/rakleed/Developer/eslint-react-oxc-migration/node_modules/oxlint/dist/lint.js:17920:70)
  │     at walkNode (file:///Users/rakleed/Developer/eslint-react-oxc-migration/node_modules/oxlint/dist/lint.js:17319:4)
  │     at walkJSXElement (file:///Users/rakleed/Developer/eslint-react-oxc-migration/node_modules/oxlint/dist/lint.js:17900:109)
  │     at walkNode (file:///Users/rakleed/Developer/eslint-react-oxc-migration/node_modules/oxlint/dist/lint.js:17304:4)
  │     at walkNode (file:///Users/rakleed/Developer/eslint-react-oxc-migration/node_modules/oxlint/dist/lint.js:17007:33)
  │     at walkCallExpression (file:///Users/rakleed/Developer/eslint-react-oxc-migration/node_modules/oxlint/dist/lint.js:17656:182)
  │     at walkNode (file:///Users/rakleed/Developer/eslint-react-oxc-migration/node_modules/oxlint/dist/lint.js:17121:4)

...

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors