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
+ // ]
0 commit comments