eslint-config-xo
eslint-config-xo copied to clipboard
Migrate to flat config
eslint-config-xo-typescript may need expose an array instead of an object https://github.com/xojs/eslint-config-xo-typescript/blob/3271346cfa8cdc2d44bee64718399eea9f603ea3/index.js#L737
Should we expose an array here too?
So user can
export {default} from 'eslint-config-xo';
and
import eslintConfigXo from 'eslint-config-xo';
export default [
- eslintConfigXo,
+ ...eslintConfigXo,
];
eslint-config-xo-typescript
Do you need separate packages anymore? My understanding is that configurations are now configurable, so you can just expose a function and pass typescript:true, spaces:4, etc if needed. See https://github.com/antfu/eslint-config?tab=readme-ov-file#customization
Perhaps you can work on a baseline eslint-config-xo first and the progressively integrate the rest after a successful launch.
But eslint-config-xo-typescript need extra packages installed/imported, it's not good if user only uses js syntax.
Should we expose an array here too?
Looks like shared config can be an object, maybe arrays will be flattened too, if it's true, we don't need care, I'll test.
But eslint-config-xo-typescript need extra packages installed/imported, it's not good if user only uses js syntax.
That hasn't been a limiting factor for XO itself, which includes TypeScript and Prettier whether you use them or not.
In an ideal world, eslint-config-xo contains all the logic XO needs, and XO becomes a wrapper around eslint and eslint-config-xo without a lot of glue. This way users can choose xo-cli or eslint + eslint-config-xo without losing much.
Waiting for answers https://github.com/eslint/eslint/issues/18563
I don't want to merge the TS one into this one yet.
The "space" config should be merged into this one though. It was only a separate package because of ESLint limitations.
Let's export an array? Check discussion in https://github.com/eslint/eslint/issues/18563
👍
I would also consider eventually upstreaming
eslint-config-xointoxoand let it be run through eitherxoor be extended and run througheslint.
xo includes cli modules (as well as the whole of Prettier), which eslint wouldn't use. Since there won't be a xo-cli package I think it can stay as eslint-config-xo
Sorry that I didn't get time to check feedbacks.
Hey, do you think it makes sense to add a legacy support like they did over here in vitest: https://github.com/vitest-dev/eslint-plugin-vitest/pull/434/files
@Primajin Open a new issue for that discussion. Personally I would say: No, it does not make sense :)