Skip to content

Commit 8634cf9

Browse files
committed
feat(lint): enforce import/no-duplicates and import/first
1 parent b28fc68 commit 8634cf9

2 files changed

Lines changed: 15 additions & 7 deletions

File tree

‎.oxlintrc.json‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,11 @@
6262
"eslint/symbol-description": "error",
6363
"eslint/unicode-bom": "error",
6464
"eslint/yoda": "error",
65-
// Only import rules verified clean in the survey are activated in this tranche.
6665
"import/default": "off",
67-
// Campaign follow-ups: clean import/first and import/no-duplicates before enabling them.
68-
"import/first": "off",
66+
"import/first": "error",
6967
"import/namespace": "off",
7068
"import/no-absolute-path": "error",
71-
"import/no-duplicates": "off",
69+
"import/no-duplicates": "error",
7270
"import/no-empty-named-blocks": "error",
7371
"import/no-named-as-default": "off",
7472
"import/no-named-as-default-member": "off",
@@ -290,9 +288,18 @@
290288
"**/*test-support.ts"
291289
],
292290
"rules": {
291+
// Vitest hoists mock setup above static imports, so this ordering is intentional in tests.
292+
"import/first": "off",
293293
"typescript/no-explicit-any": "off"
294294
}
295295
},
296+
{
297+
"files": ["src/agents/subagents/registry/subagent-registry.ts"],
298+
"rules": {
299+
// Preserve the explicit maintenance side-effect import's module-request order.
300+
"import/first": "off"
301+
}
302+
},
296303
{
297304
"files": [
298305
"src/**/*.{js,ts,mts,cts}",

‎test/scripts/oxlint-config.test.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ const ZERO_BASELINE_RULES = [
5353
"eslint/unicode-bom",
5454
"eslint/yoda",
5555
"import/no-absolute-path",
56+
"import/first",
57+
"import/no-duplicates",
5658
"import/no-empty-named-blocks",
5759
"import/no-self-import",
5860
"node/no-exports-assign",
@@ -112,9 +114,7 @@ const ZERO_BASELINE_RULES = [
112114

113115
const DEFERRED_IMPORT_RULES = [
114116
"import/default",
115-
"import/first",
116117
"import/namespace",
117-
"import/no-duplicates",
118118
"import/no-named-as-default",
119119
"import/no-named-as-default-member",
120120
"import/no-unassigned-import",
@@ -240,6 +240,7 @@ describe("oxlint config", () => {
240240
"**/*test-support.ts",
241241
],
242242
rules: {
243+
"import/first": "off",
243244
"typescript/no-explicit-any": "off",
244245
},
245246
},
@@ -312,7 +313,7 @@ describe("oxlint config", () => {
312313
]);
313314
});
314315

315-
it("enables clean zero-baseline lint rules and keeps import campaigns off", () => {
316+
it("enables clean zero-baseline lint rules and keeps deferred import rules off", () => {
316317
const config = readJson(".oxlintrc.json") as OxlintConfig;
317318

318319
expect(config.plugins).toContain("import");

0 commit comments

Comments
 (0)