Oxlint doesn't follow `extends` directive in .eslintrc.json
Given a .eslint.json file like this:
{
"extends": "../.eslintrc.json",
"rules": {
"no-console": "error",
"brace-style": "off"
}
}
Oxlint will only check for these two rules, ignoring all the parent rules from ../.eslintrc.json.
Running oxlint with the following command:
oxlint --symlinks -c ../.eslintrc.json -A unicorn --deny-warnings --tsconfig ./tsconfig.json .
I think this is known. Couldn't find it in the docs but I remembered reading it here.
I'm in the process of setting up json schema, it will solve the discoverability issue.
As for supporting extends, I think it's valuable so I'll keep this feature request open.
@Boshen I can implement the extends resolution; Last night I actually did some work on it; But it seems like we are changing the ESLintConfig load process which would conflict with my changes.
I was planning to create an ESLintConfigBuilder that would resolve the stuff after deserialization and build an ESLintConfig.
I don't know the scope of changes in #3355; So let me know whether I should wait for you to merge those changes, start stacking on top of it; Or ignore it and let you merge with it.
Of course, I can also put a pin in it if you don't find it necessary at the moment.
@Boshen I can implement the
extendsresolution; Last night I actually did some work on it; But it seems like we are changing theESLintConfigload process which would conflict with my changes.I was planning to create an
ESLintConfigBuilderthat would resolve the stuff after deserialization and build anESLintConfig.I don't know the scope of changes in #3355; So let me know whether I should wait for you to merge those changes, start stacking on top of it; Or ignore it and let you merge with it.
Of course, I can also put a pin in it if you don't find it necessary at the moment.
I'm currently working on json schema support using the schematic crate, there is a automatic extends support https://moonrepo.github.io/schematic/config/struct/extend.html I wanna try.
I'll let you know once it's done.
@Boshen I can implement the
extendsresolution; Last night I actually did some work on it; But it seems like we are changing theESLintConfigload process which would conflict with my changes. I was planning to create anESLintConfigBuilderthat would resolve the stuff after deserialization and build anESLintConfig. I don't know the scope of changes in #3355; So let me know whether I should wait for you to merge those changes, start stacking on top of it; Or ignore it and let you merge with it. Of course, I can also put a pin in it if you don't find it necessary at the moment.I'm currently working on json schema support using the
schematiccrate, there is a automatic extends support https://moonrepo.github.io/schematic/config/struct/extend.html I wanna try.I'll let you know once it's done.
It seems nice, especially if we somehow get to pass the eslintrc path to resolve relative extends. That's the main reason I've tried it with a builder, When we deserialize string directly (for example for test runners) we don't get to resolve relative extends.
What's the status of this issue? were you able to take advantage of extends support in schematic?
.oxlintrc.json now supports the extends keyword in https://github.com/oxc-project/oxc/issues/9307. Something like this from the original example will work:
// .oxlintrc.json
{
"extends": ["../.eslintrc.json"],
"rules": {
// ...
}
}