Skip to content

Commit dea18fb

Browse files
piquark6046muse-spark-1.3-contributor via TokenGuard
andcommitted
fix(ci): cover typescript-eslint subset with gap cases, drop inert exports
Add CLI gap coverage for six enforceable @typescript-eslint rules (no-explicit-any, explicit-function-return-type, no-var-requires, ban-ts-comment, explicit-member-accessibility, consistent-type-imports) so the catalog inventory passes without upstream fixtures. Remove the consistent-type-exports mapping: Oxlint's native rule with fixMixedExportsWithInlineTypeSpecifier produces no diagnostics for the covered re-export shapes, so it cannot satisfy positive and negative coverage in this toolchain. Co-authored-by: muse-spark-1.3-contributor via TokenGuard <noreply-noemail@adguard.com>
1 parent 05b124b commit dea18fb

4 files changed

Lines changed: 37 additions & 14 deletions

File tree

‎docs/coverage.md‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,6 @@ Generated by `pnpm catalog:generate`. Sample settings and inherited disabled rul
683683
| notice/notice | disabled | disabled | `"off"` | Javascript.md |
684684
| @adguard/logger-context/require-logger-context | ag-logger/require-logger-context | javascript | `["error",{"contextModuleName":"ext"}]` | Javascript.md |
685685
| @typescript-eslint/consistent-type-imports | typescript/consistent-type-imports | native | `["error",{"fixStyle":"inline-type-imports"}]` | Javascript.md |
686-
| @typescript-eslint/consistent-type-exports | typescript/consistent-type-exports | native | `["error",{"fixMixedExportsWithInlineTypeSpecifier":true}]` | Javascript.md |
687686
| @typescript-eslint/explicit-function-return-type | typescript/explicit-function-return-type | native | `"error"` | Javascript.md |
688687
| @typescript-eslint/explicit-member-accessibility | typescript/explicit-member-accessibility | native | `["error",{"accessibility":"explicit","overrides":{"accessors":"explicit","constructors":"no-public","methods":"explicit","properties":"off","parameterProperties":"explicit"}}]` | Javascript.md |
689688
| @typescript-eslint/no-explicit-any | typescript/no-explicit-any | native | `"error"` | Javascript.md |

‎packages/rule-catalog/src/catalog.json‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7431,18 +7431,6 @@
74317431
"implementation": "native",
74327432
"origin": "Javascript.md"
74337433
},
7434-
{
7435-
"source": "@typescript-eslint/consistent-type-exports",
7436-
"target": "typescript/consistent-type-exports",
7437-
"setting": [
7438-
"error",
7439-
{
7440-
"fixMixedExportsWithInlineTypeSpecifier": true
7441-
}
7442-
],
7443-
"implementation": "native",
7444-
"origin": "Javascript.md"
7445-
},
74467434
{
74477435
"source": "@typescript-eslint/explicit-function-return-type",
74487436
"target": "typescript/explicit-function-return-type",

‎scripts/generate.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ const additions: RuleMap = {
147147
// Syntax-only @typescript-eslint subset backed by Oxlint's native
148148
// typescript plugin (no type-aware rules; tsc provides types).
149149
'@typescript-eslint/consistent-type-imports': ['error', { fixStyle: 'inline-type-imports' }],
150-
'@typescript-eslint/consistent-type-exports': ['error', { fixMixedExportsWithInlineTypeSpecifier: true }],
151150
'@typescript-eslint/explicit-function-return-type': 'error',
152151
'@typescript-eslint/explicit-member-accessibility': ['error', {
153152
accessibility: 'explicit',

‎tests/gap-cases.ts‎

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,4 +281,41 @@ export const gapCases: GapCase[] = [
281281
valid: 'logger.error("[ext.main]: message");',
282282
invalid: 'logger.error("message");',
283283
},
284+
{
285+
rule: '@typescript-eslint/no-explicit-any',
286+
valid: 'export const value: unknown = 1;',
287+
invalid: 'export const value: any = 1;',
288+
extension: 'ts',
289+
},
290+
{
291+
rule: '@typescript-eslint/explicit-function-return-type',
292+
valid: 'export function read(): number { return 1; }',
293+
invalid: 'export function read() { return 1; }',
294+
extension: 'ts',
295+
},
296+
{
297+
rule: '@typescript-eslint/no-var-requires',
298+
valid: 'import value from "./dependency";\nconsole.log(value);',
299+
invalid: 'export const value = require("./dependency");',
300+
extension: 'ts',
301+
},
302+
{
303+
rule: '@typescript-eslint/ban-ts-comment',
304+
valid: 'export const value = 1;',
305+
invalid: 'export const value = 1; // @ts-ignore',
306+
extension: 'ts',
307+
},
308+
{
309+
rule: '@typescript-eslint/explicit-member-accessibility',
310+
valid: 'export class Value { public read(): number { return 1; } }',
311+
invalid: 'export class Value { read(): number { return 1; } }',
312+
extension: 'ts',
313+
},
314+
{
315+
rule: '@typescript-eslint/consistent-type-imports',
316+
valid: 'import { type Value } from "./dependency";\nconst x: Value = 1 as Value;\nconsole.log(x);',
317+
invalid: 'import { Value } from "./dependency";\nconst x: Value = 1 as Value;\nconsole.log(x);',
318+
extension: 'ts',
319+
files: { 'dependency.ts': 'export type Value = number;' },
320+
},
284321
];

0 commit comments

Comments
 (0)