Skip to content

Commit

Permalink
fix eslint after upgrade FWIW
Browse files Browse the repository at this point in the history
  • Loading branch information
Fcmam5 committed Jan 23, 2025
1 parent 599249f commit 3ca2719
Show file tree
Hide file tree
Showing 13 changed files with 227 additions and 129 deletions.
25 changes: 0 additions & 25 deletions examples/express-example-with-default-settings/.eslintrc.js

This file was deleted.

46 changes: 46 additions & 0 deletions examples/express-example-with-default-settings/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import typescriptEslintEslintPlugin from "@typescript-eslint/eslint-plugin";
import globals from "globals";
import tsParser from "@typescript-eslint/parser";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

export default [{
ignores: ["**/.eslintrc.js"],
}, ...compat.extends("plugin:@typescript-eslint/recommended", "plugin:prettier/recommended"), {
plugins: {
"@typescript-eslint": typescriptEslintEslintPlugin,
},

languageOptions: {
globals: {
...globals.node,
...globals.jest,
},

parser: tsParser,
ecmaVersion: 5,
sourceType: "module",

parserOptions: {
project: "tsconfig.json",
tsconfigRootDir: "/Users/fcmam5/lab/nest-http-problem-details/examples/express-example-with-default-settings",
},
},

rules: {
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "off",
},
}];
4 changes: 4 additions & 0 deletions examples/express-example-with-default-settings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
"rxjs": "^7.8.1"
},
"devDependencies": {
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.18.0",
"@nestjs/cli": "^11.0.2",
"@nestjs/schematics": "^11.0.0",
"@nestjs/testing": "^11.0.4",
Expand All @@ -37,6 +39,8 @@
"eslint": "^9.18.0",
"eslint-config-prettier": "^10.0.1",
"eslint-plugin-prettier": "^5.2.3",
"globals": "^15.14.0",
"install": "^0.13.0",
"jest": "^29.7.0",
"prettier": "^3.4.2",
"source-map-support": "^0.5.21",
Expand Down
58 changes: 36 additions & 22 deletions examples/express-example-with-default-settings/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class DragonsController {
getOneById(
@Param('id', ParseIntPipe) id: number,
@Query('title') hasTitle?: boolean,
@Query('details') hasDetails?: boolean
@Query('details') hasDetails?: boolean,
// @Query('has-details') hasDetails?: boolean,
): IDragonResponse {
const dragon = this.service.getByIdOrNull(id);
Expand All @@ -36,7 +36,7 @@ export class DragonsController {
if (hasTitle && hasDetails) {
throw new NotFoundException(
'Dragon not found',
`Could not find any dragon with ID: ${id}`
`Could not find any dragon with ID: ${id}`,
);
}

Expand Down
25 changes: 0 additions & 25 deletions examples/fastify-example-with-default-settings/.eslintrc.js

This file was deleted.

46 changes: 46 additions & 0 deletions examples/fastify-example-with-default-settings/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import typescriptEslintEslintPlugin from "@typescript-eslint/eslint-plugin";
import globals from "globals";
import tsParser from "@typescript-eslint/parser";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

export default [{
ignores: ["**/.eslintrc.js"],
}, ...compat.extends("plugin:@typescript-eslint/recommended", "plugin:prettier/recommended"), {
plugins: {
"@typescript-eslint": typescriptEslintEslintPlugin,
},

languageOptions: {
globals: {
...globals.node,
...globals.jest,
},

parser: tsParser,
ecmaVersion: 5,
sourceType: "module",

parserOptions: {
project: "tsconfig.json",
tsconfigRootDir: "/Users/fcmam5/lab/nest-http-problem-details/examples/fastify-example-with-default-settings",
},
},

rules: {
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "off",
},
}];
4 changes: 4 additions & 0 deletions examples/fastify-example-with-default-settings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
"rxjs": "^7.8.1"
},
"devDependencies": {
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.18.0",
"@nestjs/cli": "^11.0.2",
"@nestjs/schematics": "^11.0.0",
"@nestjs/testing": "^11.0.4",
Expand All @@ -36,6 +38,8 @@
"eslint": "^9.18.0",
"eslint-config-prettier": "^10.0.1",
"eslint-plugin-prettier": "^5.2.3",
"globals": "^15.14.0",
"install": "^0.13.0",
"jest": "^29.7.0",
"prettier": "^3.4.2",
"source-map-support": "^0.5.21",
Expand Down
Loading

0 comments on commit 3ca2719

Please sign in to comment.