Skip to content

Commit 90d4dea

Browse files
authored
Feat: Update config of eslint version to 9 (#30)
1 parent ea4fd45 commit 90d4dea

File tree

5 files changed

+66
-44
lines changed

5 files changed

+66
-44
lines changed

.eslintrc.js

Lines changed: 0 additions & 34 deletions
This file was deleted.

eslint.config.mjs

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import { FlatCompat } from '@eslint/eslintrc';
2+
import js from '@eslint/js';
3+
import typescriptEslint from '@typescript-eslint/eslint-plugin';
4+
import tsParser from '@typescript-eslint/parser';
5+
import globals from 'globals';
6+
import path from 'node:path';
7+
import { fileURLToPath } from 'node:url';
8+
9+
const __filename = fileURLToPath(import.meta.url);
10+
const __dirname = path.dirname(__filename);
11+
const compat = new FlatCompat({
12+
baseDirectory: __dirname,
13+
recommendedConfig: js.configs.recommended,
14+
allConfig: js.configs.all,
15+
});
16+
17+
export default [
18+
{
19+
ignores: ['**/.eslintrc.js'],
20+
},
21+
...compat.extends(
22+
'plugin:@typescript-eslint/recommended',
23+
'plugin:prettier/recommended',
24+
),
25+
{
26+
plugins: {
27+
'@typescript-eslint': typescriptEslint,
28+
},
29+
30+
languageOptions: {
31+
globals: {
32+
...globals.node,
33+
...globals.jest,
34+
},
35+
36+
parser: tsParser,
37+
ecmaVersion: 5,
38+
sourceType: 'module',
39+
40+
parserOptions: {
41+
project: 'tsconfig.json',
42+
tsconfigRootDir: __dirname,
43+
},
44+
},
45+
46+
rules: {
47+
'@typescript-eslint/interface-name-prefix': 'off',
48+
'@typescript-eslint/explicit-function-return-type': 'off',
49+
'@typescript-eslint/explicit-module-boundary-types': 'off',
50+
'@typescript-eslint/no-explicit-any': 'off',
51+
},
52+
},
53+
];

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"author": "",
66
"private": true,
77
"license": "MIT",
8+
"type": "commonjs",
89
"lint-staged": {
910
"**/*": "prettier --write --ignore-unknown"
1011
},
@@ -65,6 +66,8 @@
6566
"uuid": "^10.0.0"
6667
},
6768
"devDependencies": {
69+
"@eslint/eslintrc": "^3.1.0",
70+
"@eslint/js": "^9.8.0",
6871
"@nestjs/cli": "^10.4.2",
6972
"@nestjs/schematics": "^10.1.3",
7073
"@nestjs/testing": "^10.3.10",
@@ -87,6 +90,7 @@
8790
"eslint": "^9.8.0",
8891
"eslint-config-prettier": "^9.1.0",
8992
"eslint-plugin-prettier": "^5.2.1",
93+
"globals": "^15.8.0",
9094
"husky": "^9.1.4",
9195
"jest": "^29.7.0",
9296
"pg-mem": "^2.8.1",

tsconfig.json

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@
1818
"forceConsistentCasingInFileNames": false,
1919
"noFallthroughCasesInSwitch": false
2020
},
21-
"include": [
22-
"additional.d.ts",
23-
"**/*.ts",
24-
"**/*.tsx",
25-
],
26-
"exclude": [
27-
"node_modules"
28-
],
29-
}
21+
"include": ["additional.d.ts", "**/*.ts", "**/*.tsx", "**/*.mjs"],
22+
"exclude": ["node_modules"]
23+
}

yarn.lock

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1293,7 +1293,7 @@
12931293
minimatch "^3.1.2"
12941294
strip-json-comments "^3.1.1"
12951295

1296-
"@eslint/js@9.8.0":
1296+
"@eslint/js@9.8.0", "@eslint/js@^9.8.0":
12971297
version "9.8.0"
12981298
resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.8.0.tgz#ae9bc14bb839713c5056f5018bcefa955556d3a4"
12991299
integrity sha512-MfluB7EUfxXtv3i/++oh89uzAr4PDI4nn201hsp+qaXqsjAWzinlZEHEfPgAX4doIlKvPG/i0A9dpKxOLII8yA==
@@ -5526,6 +5526,11 @@ globals@^14.0.0:
55265526
resolved "https://registry.yarnpkg.com/globals/-/globals-14.0.0.tgz#898d7413c29babcf6bafe56fcadded858ada724e"
55275527
integrity sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==
55285528

5529+
globals@^15.8.0:
5530+
version "15.8.0"
5531+
resolved "https://registry.yarnpkg.com/globals/-/globals-15.8.0.tgz#e64bb47b619dd8cbf32b3c1a0a61714e33cbbb41"
5532+
integrity sha512-VZAJ4cewHTExBWDHR6yptdIBlx9YSSZuwojj9Nt5mBRXQzrKakDsVKQ1J63sklLvzAJm0X5+RpO4i3Y2hcOnFw==
5533+
55295534
globby@^11.1.0:
55305535
version "11.1.0"
55315536
resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b"

0 commit comments

Comments
 (0)