linter: `import/extensions` ignores `ignorePackages` and `checkTypeImports` when `pattern` is present
Author: cmaciasjimenezCreated Sep 24, 2026Updated Sep 30, 2026
LabelsA-linter
What version of Oxlint are you using?
1.85.0
What command did you run?
oxlint -c <config>.json probe.ts
What does your .oxlintrc.json config file look like?
Two configurations, each with pattern beside another option:
{ "plugins": ["import"], "rules": { "import/extensions": ["error", "always", { "checkTypeImports": true, "pattern": { "js": "never" } }] } }{ "plugins": ["import"], "rules": { "import/extensions": ["error", "always", { "ignorePackages": true, "pattern": { "ts": "always" } }] } }What happened?
probe.ts, next to page.ts and an installed package @scope/pkg:
import { value } from "@scope/pkg";
import type { Page } from "./page.js";- With
checkTypeImports: truebesidepattern, the type import is not reported. The same options in the flat form,{ "checkTypeImports": true, "js": "never" }, report it:File extension "js" should not be included in the import declaration. - With
ignorePackages: truebesidepattern, the package import is reported:Missing file extension in import declaration.
The rule's documentation lists pattern, ignorePackages and checkTypeImports as siblings in the options object, as eslint-plugin-import does.
The cause appears to be from_configuration in crates/oxc_linter/src/rules/import/extensions.rs: let root = val.get("pattern").unwrap_or(val); passes only the pattern object to ExtensionsConfig::from_json_value, which then reads ignorePackages and checkTypeImports from pattern instead of from the options object. The line is unchanged on main as of 2026-09-24.
Source: oxc-project/oxc