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

xo does not appear to use extends: ["plugin:?"] when specified in config #693

Closed
bbugh opened this issue Oct 4, 2022 · 3 comments
Closed
Labels

Comments

@bbugh
Copy link

bbugh commented Oct 4, 2022

Hi! 👋🏻 thanks for this great tool, seems like it will save me a ton of time setting this all up on every project.

I noticed that some rules I prefer, like @typescript-eslint/no-non-null-assertion wasn't included, so I attempted to add it by using the extends of xo config in package.json (and .xo-config.json while testing):

  "xo": {
    "extends": [
      "plugin:@typescript-eslint/eslint-recommended",
      "plugin:@typescript-eslint/recommended-requiring-type-checking"
    ]
  }

And expected to see Forbidden non-null assertion. eslint(@typescript-eslint/no-non-null-assertion) on this code:

document.getElementById("whatever")!

but it did not appear. Running

npx xo --print-config src/main.ts

does not show the extra rules provided by the extended plugins.

I've read through the documentation and looked through all of the issues that GitHub's issue search would show and it seems like this should work.

I created an example repo here: https://github.com/bbugh/xo-not-using-extends - just need to run

npm install
npx xo --print-config src/main.ts
@jonatandorozco
Copy link

jonatandorozco commented Oct 8, 2022

I don't know if it's related or not, but ESLint made a rewrite on its configuration system, extends it's not used anymore.

You can check it on:
https://eslint.org/blog/2022/08/new-config-system-part-2/

@bbugh
Copy link
Author

bbugh commented Oct 9, 2022

I'm not sure either, but from this comment, it doesn't sound like xo is using the prerelease eslint flat config.

@fregante fregante added the bug label Jan 4, 2023
@fregante
Copy link
Member

fregante commented Nov 6, 2024

While likely still valid (as it's documented in the readme), this will be fixed but the upcoming flat config:

I don't expect anyone picking up work on the old config anymore

@fregante fregante closed this as not planned Won't fix, can't repro, duplicate, stale Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants