Skip to content

Commit 986f598

Browse files
Upgrade packages and prepare ESLint 9 (#34)
1 parent 644175d commit 986f598

File tree

4 files changed

+340
-226
lines changed

4 files changed

+340
-226
lines changed

.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"plugin:import/typescript"
1616
],
1717
"plugins": ["@typescript-eslint"],
18-
"ignorePatterns": ["build", "src/migrations", "jest.config.ts"],
18+
"ignorePatterns": ["build", "src/migrations", "jest.config.ts", "eslint.config.js.future"],
1919
"rules": {
2020
"spaced-comment": "warn",
2121
"no-console": ["warn", { "allow": ["warn", "error", "info"] }],

eslint.config.js.future

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
// ****************************************************************************************** //
2+
// This ESLint configuration file is for ESLint 9. It's not used yet but if you absolutely //
3+
// want to use ESLint 9, delete file .eslintrc.json, remove .future in the name of this file //
4+
// then upgrade eslint, remove @typescript-eslint/eslint-plugin and @typescript-eslint/parser //
5+
// add eslint/js and typescript-eslint. //
6+
// ****************************************************************************************** //
7+
8+
const globals = require("globals");
9+
const jseslint = require("@eslint/js");
10+
const tseslint = require('typescript-eslint');
11+
12+
module.exports = tseslint.config({
13+
files: ['**/*.ts'],
14+
ignores: ["build/*", "src/migrations/*", "jest.config.ts"],
15+
extends: [
16+
jseslint.configs.recommended,
17+
...tseslint.configs.recommended,
18+
],
19+
languageOptions: {
20+
parser: tseslint.parser,
21+
parserOptions: {
22+
project: true,
23+
},
24+
ecmaVersion: 2020,
25+
sourceType: "module",
26+
globals: {
27+
...globals.node,
28+
...globals.browser,
29+
}
30+
},
31+
plugins: {
32+
'@typescript-eslint': tseslint.plugin,
33+
},
34+
rules: {
35+
"spaced-comment": "warn",
36+
"no-console": ["warn", { "allow": ["warn", "error", "info"] }],
37+
"no-duplicate-imports": "off",
38+
"no-multiple-empty-lines": ["error", { "max": 1 }],
39+
"camelcase": "warn",
40+
"object-curly-spacing": ["error", "always"],
41+
"require-await": "off",
42+
"arrow-body-style": ["error", "as-needed"],
43+
"eqeqeq": "error",
44+
"quotes": ["warn", "single"],
45+
46+
"@typescript-eslint/await-thenable": "error",
47+
"@typescript-eslint/require-await": "error",
48+
"@typescript-eslint/no-unnecessary-condition": "warn",
49+
"@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "req|res|next|err" }],
50+
"@typescript-eslint/consistent-type-imports": ["error", { "prefer": "type-imports" }],
51+
"@typescript-eslint/no-floating-promises": "error",
52+
"@typescript-eslint/semi": ["warn"],
53+
"@typescript-eslint/member-delimiter-style": ["error", {
54+
"multiline": {
55+
"delimiter": "semi",
56+
"requireLast": true
57+
},
58+
"singleline": {
59+
"delimiter": "semi",
60+
"requireLast": false
61+
}
62+
}],
63+
}
64+
});
65+
66+
// Those rules were previously in the config but because of the upgrade to ESLint 9, they are no longer supported
67+
// Add them back when eslint-plugin-import will be support ESLint 9
68+
// "import/default": "off",
69+
// "import/no-duplicates": ["error"],
70+
// "import/no-named-as-default-member": "off",
71+
// "import/order": [
72+
// "error",
73+
// {
74+
// "groups": [
75+
// ["builtin", "external"],
76+
// ["internal", "index", "sibling", "parent", "object"]
77+
// ],
78+
// "newlines-between": "always-and-inside-groups"
79+
// }
80+
// ]

package.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,47 +9,47 @@
99
"bcryptjs": "^2.4.3",
1010
"connect-pg-simple": "^9.0.1",
1111
"cors": "^2.8.5",
12-
"dotenv": "^16.3.1",
12+
"dotenv": "^16.4.5",
1313
"express": "^4.19.2",
1414
"express-async-errors": "^3.1.1",
15-
"express-session": "^1.17.3",
15+
"express-session": "^1.18.0",
1616
"helmet": "^7.1.0",
1717
"http-errors": "^2.0.0",
1818
"morgan": "^1.10.0",
1919
"passport": "^0.7.0",
2020
"passport-local": "^1.0.0",
21-
"pg": "^8.11.3",
22-
"reflect-metadata": "^0.2.1",
21+
"pg": "^8.11.5",
22+
"reflect-metadata": "^0.2.2",
2323
"tslib": "^2.6.2",
24-
"typeorm": "^0.3.19",
24+
"typeorm": "^0.3.20",
2525
"validator": "^13.11.0"
2626
},
2727
"devDependencies": {
2828
"@types/bcryptjs": "^2.4.6",
2929
"@types/connect-pg-simple": "^7.0.3",
3030
"@types/cors": "^2.8.17",
3131
"@types/express": "^4.17.21",
32-
"@types/express-session": "^1.17.10",
32+
"@types/express-session": "^1.18.0",
3333
"@types/http-errors": "^2.0.4",
34-
"@types/jest": "^29.5.11",
34+
"@types/jest": "^29.5.12",
3535
"@types/morgan": "^1.9.9",
36-
"@types/node": "^20.11.0",
36+
"@types/node": "^20.12.7",
3737
"@types/passport": "^1.0.16",
3838
"@types/passport-local": "^1.0.38",
3939
"@types/supertest": "^6.0.2",
40-
"@types/validator": "^13.11.8",
41-
"@typescript-eslint/eslint-plugin": "^6.18.1",
42-
"@typescript-eslint/parser": "^6.18.1",
40+
"@types/validator": "^13.11.9",
41+
"@typescript-eslint/eslint-plugin": "^7.7.1",
42+
"@typescript-eslint/parser": "^7.7.1",
4343
"eslint": "^8.56.0",
4444
"eslint-import-resolver-typescript": "^3.6.1",
4545
"eslint-plugin-eslint-comments": "^3.2.0",
4646
"eslint-plugin-import": "^2.29.1",
4747
"jest": "^29.7.0",
48-
"nodemon": "^3.0.2",
49-
"supertest": "^6.3.4",
50-
"ts-jest": "^29.1.1",
48+
"nodemon": "^3.1.0",
49+
"supertest": "^7.0.0",
50+
"ts-jest": "^29.1.2",
5151
"ts-node": "^10.9.2",
52-
"typescript": "^5.3.3"
52+
"typescript": "^5.4.5"
5353
},
5454
"scripts": {
5555
"start": "node build/index.js",

0 commit comments

Comments
 (0)