sample(11-swagger): update lint configuration

This commit is contained in:
Kamil Myśliwiec
2025-01-16 12:52:12 +01:00
parent a0648042ac
commit d944fa515b
3 changed files with 49 additions and 30 deletions

View File

@@ -1,23 +0,0 @@
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin'],
extends: [
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
],
root: true,
env: {
node: true,
jest: true,
},
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
};

View File

@@ -0,0 +1,42 @@
// @ts-check
import eslint from '@eslint/js';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
import globals from 'globals';
import tseslint from 'typescript-eslint';
export default tseslint.config(
{
ignores: ['eslint.config.mjs'],
},
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
eslintPluginPrettierRecommended,
{
languageOptions: {
globals: {
...globals.node,
...globals.jest,
},
ecmaVersion: 5,
sourceType: 'module',
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
{
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/no-unsafe-argument': 'warn',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-unsafe-assignment': 'warn',
'@typescript-eslint/no-unsafe-call': 'warn',
'@typescript-eslint/no-unsafe-member-access': 'warn',
'@typescript-eslint/require-await': 'warn',
'@typescript-eslint/no-unused-vars': 'warn',
},
},
);

View File

@@ -19,10 +19,10 @@
"test:e2e": "echo 'No e2e tests implemented yet.'"
},
"dependencies": {
"@nestjs/common": "10.4.15",
"@nestjs/core": "10.4.15",
"@nestjs/platform-express": "10.4.15",
"@nestjs/swagger": "8.1.1",
"@nestjs/common": "11.0.0",
"@nestjs/core": "^11.0.0",
"@nestjs/platform-express": "11.0.0",
"@nestjs/swagger": "^11.0.0-next.1",
"class-transformer": "0.5.1",
"class-validator": "0.14.1",
"reflect-metadata": "0.2.2",
@@ -34,9 +34,9 @@
"@eslint/js": "9.18.0",
"@nestjs/cli": "10.4.9",
"@nestjs/schematics": "10.2.3",
"@nestjs/testing": "10.4.15",
"@types/express": "4.17.21",
"@types/node": "22.10.6",
"@nestjs/testing": "11.0.0",
"@types/express": "5.0.0",
"@types/node": "22.10.7",
"@types/supertest": "6.0.2",
"eslint": "9.18.0",
"eslint-plugin-prettier": "5.2.2",