build(backend): add nestjs-typed eslint plugin

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2023-06-25 19:34:54 +02:00 committed by Tilman Vatteroth
parent e8e72c5328
commit 8daffbb11b
3 changed files with 25 additions and 4 deletions

View file

@ -39,12 +39,13 @@ module.exports = {
}, },
}, },
], ],
plugins: ['@typescript-eslint', 'jest', 'eslint-plugin-local-rules'], plugins: ['@typescript-eslint', 'jest', 'eslint-plugin-local-rules','@darraghor/nestjs-typed'],
extends: [ extends: [
'eslint:recommended', 'eslint:recommended',
'plugin:@typescript-eslint/recommended', 'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking', 'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:prettier/recommended', 'plugin:prettier/recommended',
'plugin:@darraghor/nestjs-typed/recommended'
], ],
root: true, root: true,
env: { env: {
@ -87,5 +88,7 @@ module.exports = {
format: ['PascalCase'], format: ['PascalCase'],
}, },
], ],
// We have our own OpenApi decorator and don't directly use the one from NestJS
'@darraghor/nestjs-typed/api-method-should-specify-api-response': 'off',
}, },
}; };

View file

@ -78,6 +78,7 @@
"yjs": "13.6.6" "yjs": "13.6.6"
}, },
"devDependencies": { "devDependencies": {
"@darraghor/eslint-plugin-nestjs-typed": "3.22.6",
"@nestjs/cli": "10.1.7", "@nestjs/cli": "10.1.7",
"@nestjs/schematics": "10.0.1", "@nestjs/schematics": "10.0.1",
"@nestjs/testing": "10.0.5", "@nestjs/testing": "10.0.5",

View file

@ -2162,6 +2162,22 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@darraghor/eslint-plugin-nestjs-typed@npm:3.22.6":
version: 3.22.6
resolution: "@darraghor/eslint-plugin-nestjs-typed@npm:3.22.6"
dependencies:
"@typescript-eslint/scope-manager": ^5.59.8
"@typescript-eslint/utils": ^5.59.8
eslint-module-utils: 2.8.0
reflect-metadata: 0.1.13
peerDependencies:
"@typescript-eslint/parser": ^5.0.0
class-validator: "*"
eslint: ^8.0.0
checksum: bb7fc9f1ae406e9b7eb7acf5fce03446c8b6ca60107f965fac88679f7b69355a0c4511579bbd91f0a6c4b6c460059497a445aa0727b9b5479291cbbc4996aa6f
languageName: node
linkType: hard
"@emotion/cache@npm:^10.0.27": "@emotion/cache@npm:^10.0.27":
version: 10.0.29 version: 10.0.29
resolution: "@emotion/cache@npm:10.0.29" resolution: "@emotion/cache@npm:10.0.29"
@ -2313,6 +2329,7 @@ __metadata:
resolution: "@hedgedoc/backend@workspace:backend" resolution: "@hedgedoc/backend@workspace:backend"
dependencies: dependencies:
"@azure/storage-blob": 12.14.0 "@azure/storage-blob": 12.14.0
"@darraghor/eslint-plugin-nestjs-typed": 3.22.6
"@hedgedoc/commons": "workspace:commons" "@hedgedoc/commons": "workspace:commons"
"@mrdrogdrog/optional": 1.1.0 "@mrdrogdrog/optional": 1.1.0
"@nestjs/cli": 10.1.7 "@nestjs/cli": 10.1.7
@ -5332,7 +5349,7 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@typescript-eslint/scope-manager@npm:5.61.0": "@typescript-eslint/scope-manager@npm:5.61.0, @typescript-eslint/scope-manager@npm:^5.59.8":
version: 5.61.0 version: 5.61.0
resolution: "@typescript-eslint/scope-manager@npm:5.61.0" resolution: "@typescript-eslint/scope-manager@npm:5.61.0"
dependencies: dependencies:
@ -5409,7 +5426,7 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@typescript-eslint/utils@npm:5.61.0": "@typescript-eslint/utils@npm:5.61.0, @typescript-eslint/utils@npm:^5.59.8":
version: 5.61.0 version: 5.61.0
resolution: "@typescript-eslint/utils@npm:5.61.0" resolution: "@typescript-eslint/utils@npm:5.61.0"
dependencies: dependencies:
@ -9275,7 +9292,7 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"eslint-module-utils@npm:^2.7.4": "eslint-module-utils@npm:2.8.0, eslint-module-utils@npm:^2.7.4":
version: 2.8.0 version: 2.8.0
resolution: "eslint-module-utils@npm:2.8.0" resolution: "eslint-module-utils@npm:2.8.0"
dependencies: dependencies: