Skip to content

Commit 8bf9800

Browse files
feat: fix all rules and imports
Fixes the imports to match eslint 8 Fixes some rules in latest plugins
1 parent 6f8c5d9 commit 8bf9800

24 files changed

+308
-692
lines changed

.eslintrc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ module.exports = {
2929
},
3030
},
3131
],
32-
"unicorn/filename-case": ["off", {cases: ["camelCase"]}],
3332
"no-eval": "error",
3433
"@typescript-eslint/restrict-template-expressions": "off",
3534
"unicorn/no-fn-reference-in-iterator": "off",

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,5 @@ _ts3.4
7171

7272
# Files copied as part of the build
7373
packages/types/src/ast-spec.ts
74-
.jest_cache
74+
.jest_cache
75+
false

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1-
# Some eslint rules for working with NestJs projects
2-
31
## Why use this package?
42

3+
If you use NestJs (https://nestjs.com/) then these rules will help keep you usage of decorators consistent.
4+
5+
## A note on versions
6+
7+
Version 2.x supports Eslint version <=7.x and typescript eslint parser 4
8+
9+
Version 3.x supports Eslint version >=8.x and typescript eslint parser 5+
10+
11+
There were many breaking changes between these versions.
12+
513
### 1. Detect Nest Dependency Injection issues
614

715
There are some things you don't want to forget when working with Nest dependency injection.

package-lock.json

Lines changed: 245 additions & 648 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"@commitlint/config-conventional": "12.1.1",
5151
"@semantic-release/changelog": "5.0.1",
5252
"@semantic-release/exec": "5.0.0",
53-
"@types/eslint": "^7.2.12",
53+
"@types/eslint": "7.28.2",
5454
"@types/jest": "26.0.23",
5555
"@types/node": "^15.6.1",
5656
"@typescript-eslint/eslint-plugin": "5.1.0",

src/eslintExtraTypes.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
declare module "eslint/lib/cli-engine/file-enumerator" {
1+
declare module "eslint/use-at-your-own-risk" {
22
export class FileEnumerator {
33
constructor(options: {
44
cwd?: string;

src/rules/apiEnumPropertyBestPractices/apiEnumPropertyBestPractices.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import {hasEnumSpecifiedCorrectly} from "./apiEnumPropertyBestPractices";
2-
import {testCases} from "./apiEnumPropertyBestPractices.test-data";
2+
import {testCases} from "./apiEnumPropertyBestPractices.testData";
33
import {typedTokenHelpers} from "../../utils/typedTokenHelpers";
44
import {
55
fakeContext,
66
fakeFilePath,
7-
} from "../../utils/nestModules/nestProvidedInjectableMapper.test-date";
7+
} from "../../utils/nestModules/nestProvidedInjectableMapper.testData";
88
import {TSESTree} from "@typescript-eslint/types";
99

1010
// should probably be split up into multiple tests
@@ -23,6 +23,7 @@ describe("apiEnumPropertyBestPractices", () => {
2323
const ast = typedTokenHelpers.parseStringToAst(
2424
testCase.moduleCode,
2525
fakeFilePath,
26+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
2627
fakeContext
2728
);
2829

src/rules/apiEnumPropertyBestPractices/apiEnumPropertyBestPractices.test-data.ts renamed to src/rules/apiEnumPropertyBestPractices/apiEnumPropertyBestPractices.testData.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable unicorn/filename-case */
12
export const testCases = [
23
{
34
moduleCode: `enum MyEnum{

src/rules/apiMethodsShouldSpecifyApiResponse/apiMethodsShouldSpecifyApiResponse.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import {typedTokenHelpers} from "../../utils/typedTokenHelpers";
22
import {
33
fakeContext,
44
fakeFilePath,
5-
} from "../../utils/nestModules/nestProvidedInjectableMapper.test-date";
5+
} from "../../utils/nestModules/nestProvidedInjectableMapper.testData";
66
import {TSESTree} from "@typescript-eslint/types";
7-
import {testCases} from "./apiMethodsShouldSpecifyApiResponse.test-data";
7+
import {testCases} from "./apiMethodsShouldSpecifyApiResponse.testData";
88
import {shouldUseApiResponseDecorator} from "./apiMethodsShouldSpecifyApiResponse";
99

1010
// should probably be split up into multiple tests
@@ -19,6 +19,7 @@ describe("apiMethodsShouldSpecifyApiResponse", () => {
1919
const ast = typedTokenHelpers.parseStringToAst(
2020
testCase.moduleCode,
2121
fakeFilePath,
22+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
2223
fakeContext
2324
);
2425

0 commit comments

Comments
 (0)