Skip to content

Commit 217c5f9

Browse files
fix: must use newer typings for rule records
1 parent 9db3436 commit 217c5f9

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

src/configs/noSwagger.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import {Linter} from "eslint";
1+
import {TSESLint} from "@typescript-eslint/utils";
22

33
// Should turn off swagger rules for folks not using swagger typings
4-
export const rules: Partial<Linter.RulesRecord> = {
4+
export const rules: Partial<TSESLint.ClassicConfig.RulesRecord> = {
55
"@darraghor/nestjs-typed/api-property-matches-property-optionality": "off",
66
"@darraghor/nestjs-typed/api-method-should-specify-api-response": "off",
77
"@darraghor/nestjs-typed/api-method-should-specify-api-operation": "off",
@@ -11,7 +11,9 @@ export const rules: Partial<Linter.RulesRecord> = {
1111
"off",
1212
};
1313

14-
export default {
14+
const config = {
1515
extends: ["./configs/base"],
1616
rules,
1717
};
18+
19+
export default config as TSESLint.ClassicConfig.Config;

src/configs/recommended.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Linter} from "eslint";
1+
import {Linter} from "@typescript-eslint/utils/ts-eslint";
22

33
export const rules: Partial<Linter.RulesRecord> = {
44
"@darraghor/nestjs-typed/provided-injected-should-match-factory-parameters":

src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ export const parser: TSESLint.FlatConfig.Parser = {
3131
parseForESLint: parserBase.parseForESLint,
3232
};
3333

34-
const classicPlugin = {
34+
const classicPlugin: Linter.Plugin = {
3535
configs: {
36-
recommended: recommended,
37-
"no-swagger": noSwagger,
36+
recommended: recommended as unknown as TSESLint.ClassicConfig.Config,
37+
"no-swagger": noSwagger as unknown as TSESLint.ClassicConfig.Config,
3838
},
3939
rules,
4040
meta,
41-
} satisfies Linter.Plugin;
41+
};
4242

4343
export const plugin: TSESLint.FlatConfig.Plugin = classicPlugin as Omit<
4444
typeof classicPlugin,

0 commit comments

Comments
 (0)