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

@stylistic/migrate/migrate-js: Definition for rule '@stylistic/js/no-multi-spaces' was not found. #360

Closed
3 of 5 tasks
sacru2red opened this issue Apr 22, 2024 · 3 comments

Comments

@sacru2red
Copy link

Validations

Describe the bug

I am trying to migrate built-in stylistic rules to @Stylistic namespace.
following https://eslint.style/guide/migration#eslint-migrate-plugin

  • install @stylistic/eslint-plugin, @stylistic/eslint-plugin-migrate
  • change config file (.eslintrc.js)
    • add /* eslint @stylistic/migrate/migrate-js: "error" */
    • add /* eslint @stylistic/migrate/migrate-ts: "error" */
  • run fix
...
'no-multi-spaces': [
      'error',
      {
        ignoreEOLComments: true,
      },
    ],
...

to

...
'@stylistic/js/no-multi-spaces': [
      'error',
      {
        ignoreEOLComments: true,
      },
    ],
...

and then, eslint ext(vscode) warn
Definition for rule '@stylistic/js/no-multi-spaces' was not found.eslint(@stylistic/js/no-multi-spaces)

Reproduction

https://github.com/sacru2red/migrate-to-stylistic-namespace

Contributes

  • I am willing to submit a PR to fix this issue
  • I am willing to submit a PR with failing tests
@dinesh-58
Copy link

dinesh-58 commented May 23, 2024

Edit the rule name by removing the js/ portion so that it becomes '@stylistic/no-multi-spaces'. When you have installed the default plugin @stylistic/eslint-plugin instead of any of the specific ones for js, ts, or jsx, you must remove the specific plugin part from the rule name. So, for other rule names as well, remove the js/, ts/ or jsx/ part.

This is an issue with the documentation for rules coming from the default plugin. I've created an issue here

@sacru2red
Copy link
Author

@dinesh-58

Did I understand it correctly?

image

@sacru2red
Copy link
Author

sacru2red commented May 24, 2024

@dinesh-58

Did I understand it correctly?

image

I just regonized that "@Stylistic" is missing from the plugin list.....

Thank you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants