What version of Oxlint are you using?
1.43.0
What command did you run?
oxlint
What does your .oxlintrc.json config file look like?
What happened?
The import/max-dependencies rule currently counts each entry in import_entries rather than counting unique module sources. This means import { x, y, z } from './foo' is counted as 3 dependencies instead of 1.
This differs from the behavior of the original rule, which counts unique module sources.
With config { "max": 2 }, the following should be valid (2 unique dependencies: ./foo and ./bar):
import { w } from './foo';
import { x, y, z } from './bar';
But oxlint counts it as a violation:
eslint-plugin-import(max-dependencies): File has too many dependencies (4). Maximum allowed is 2.
Per the docs of the original rule, multiple named imports from the same module should count as a single dependency. The example above has 2 dependencies, not 4.
I discovered this problem while working on #19119
{ "$schema": "./node_modules/oxlint/configuration_schema.json", "plugins": [ "import" ], "categories": { "correctness": "off" }, "rules": { "import/max-dependencies": ["error", { "max": 2 }] } }