Skip to content

Commit

Permalink
Fix type GulpESLintOptions for ESLint v9 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
fasttime committed Jul 7, 2024
1 parent f49d67a commit 674c170
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/gulp-eslint-new.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,9 @@ declare namespace gulpESLintNew
}

type GulpESLintOptions =
(GulpESLintrcOptions & { configType?: 'eslintrc' | null | undefined; }) |
(GulpFlatESLintOptions & { configType: 'flat'; });
| ((GulpESLintrcOptions | GulpFlatESLintOptions) & { configType?: null | undefined; })
| (GulpESLintrcOptions & { configType: 'eslintrc'; })
| (GulpFlatESLintOptions & { configType: 'flat'; });

type GulpESLintResult = eslint.LintResult;

Expand Down
19 changes: 19 additions & 0 deletions test/ts-defs-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,25 @@ gulpESLintNew
},
);

{
let configType!: undefined | null;
gulpESLintNew
({ configType, ignorePatterns: undefined, ruleFilter: undefined, stats: undefined });
}

{
let configType!: undefined | null;
gulpESLintNew
(
{
configType,
reportUnusedDisableDirectives: undefined,
resolvePluginsRelativeTo: undefined,
rulePaths: undefined,
},
);
}

gulpESLintNew
(
{
Expand Down

0 comments on commit 674c170

Please sign in to comment.