Skip to content

Commit a586bb2

Browse files
[DISC-120] Update eslint dependency and nodejs to v20
* chore(deps): update dependency eslint to v9 * Update to eslint and babel/eslint-parser * Update lock file * Fixes for linting * Modifications to ignore node modules and consider all other files for linting * Force update of node to version 20 --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Wolfdragon24 <[email protected]>
1 parent 0762214 commit a586bb2

File tree

5 files changed

+473
-577
lines changed

5 files changed

+473
-577
lines changed

.eslintrc.json

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

.github/workflows/docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
uses: actions/checkout@v4
1313
- uses: actions/setup-node@v4
1414
with:
15-
node-version: 16
15+
node-version: 20
1616
- run: npm ci
1717
- run: npm run format:check
1818
- run: npm run lint

eslint.config.mjs

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
import prettier from "eslint-plugin-prettier";
2+
import globals from "globals";
3+
import babelParser from "@babel/eslint-parser";
4+
import path from "node:path";
5+
import { fileURLToPath } from "node:url";
6+
import js from "@eslint/js";
7+
import { FlatCompat } from "@eslint/eslintrc";
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 [...compat.extends("eslint:recommended", "prettier"), {
18+
plugins: {
19+
prettier,
20+
},
21+
22+
files: ["**/*.js"],
23+
24+
ignores: [
25+
"node_modules/**",
26+
],
27+
28+
languageOptions: {
29+
globals: {
30+
...globals.node,
31+
},
32+
33+
parser: babelParser,
34+
ecmaVersion: 2021,
35+
sourceType: "script",
36+
37+
parserOptions: {
38+
requireConfigFile: false,
39+
},
40+
},
41+
42+
rules: {
43+
"arrow-spacing": ["warn", {
44+
before: true,
45+
after: true,
46+
}],
47+
48+
"brace-style": ["error", "1tbs", {
49+
allowSingleLine: true,
50+
}],
51+
52+
"comma-dangle": ["error", "always-multiline"],
53+
"comma-spacing": "error",
54+
"comma-style": "error",
55+
curly: ["error", "multi-line", "consistent"],
56+
"dot-location": ["error", "property"],
57+
"handle-callback-err": "off",
58+
indent: "off",
59+
"keyword-spacing": "error",
60+
61+
"max-nested-callbacks": ["error", {
62+
max: 4,
63+
}],
64+
65+
"max-statements-per-line": ["error", {
66+
max: 2,
67+
}],
68+
69+
"no-console": "off",
70+
"no-empty-function": "error",
71+
"no-floating-decimal": "error",
72+
"no-inline-comments": "error",
73+
"no-lonely-if": "error",
74+
"no-multi-spaces": "error",
75+
76+
"no-multiple-empty-lines": ["error", {
77+
max: 2,
78+
maxEOF: 1,
79+
maxBOF: 0,
80+
}],
81+
82+
"no-shadow": ["error", {
83+
allow: ["err", "resolve", "reject"],
84+
}],
85+
86+
"no-trailing-spaces": ["error"],
87+
"no-var": "error",
88+
"object-curly-spacing": ["error", "always"],
89+
"prefer-const": "error",
90+
"prettier/prettier": "error",
91+
semi: ["error", "always"],
92+
"space-before-blocks": "error",
93+
"space-in-parens": "error",
94+
"space-infix-ops": "error",
95+
"space-unary-ops": "error",
96+
"spaced-comment": "error",
97+
"no-unused-vars": "warn",
98+
yoda: "error",
99+
},
100+
}];

0 commit comments

Comments
 (0)