|
1 | 1 | // Based on Odoo's .eslintrc.js
|
2 | 2 | {
|
3 |
| - "extends": ["eslint:recommended", "plugin:prettier/recommended", "plugin:node/recommended"], |
| 3 | + "extends": [ |
| 4 | + "eslint:recommended", |
| 5 | + "plugin:@typescript-eslint/recommended", |
| 6 | + "plugin:node/recommended", |
| 7 | + "plugin:prettier/recommended" |
| 8 | + ], |
4 | 9 | "parserOptions": {
|
5 | 10 | "ecmaVersion": 2022,
|
6 |
| - "sourceType": "module" |
| 11 | + "sourceType": "module", |
| 12 | + "project": "./tsconfig.json" |
7 | 13 | },
|
8 | 14 | "env": {
|
9 | 15 | "node": true,
|
10 | 16 | "browser": false,
|
11 | 17 | "es2022": true
|
12 | 18 | },
|
| 19 | + "parser": "@typescript-eslint/parser", |
| 20 | + "plugins": ["@typescript-eslint"], |
13 | 21 | "overrides": [
|
14 | 22 | {
|
15 |
| - "files": ["tests/utils/*.js", "tests/*.js"], |
| 23 | + "files": ["tests/utils/*.ts", "tests/*.ts"], |
16 | 24 | "plugins": ["jest", "import"],
|
17 | 25 | "env": {
|
18 | 26 | "jest": true,
|
|
21 | 29 | "extends": ["plugin:jest/recommended"]
|
22 | 30 | },
|
23 | 31 | {
|
24 |
| - "files": ["src/client.js"], |
| 32 | + "files": ["src/client.ts"], |
25 | 33 | "env": {
|
26 | 34 | "browser": true,
|
27 | 35 | "node": false
|
28 | 36 | }
|
29 | 37 | },
|
30 | 38 | {
|
31 |
| - "files": ["src/shared/*.js"], |
| 39 | + "files": ["src/shared/*.ts"], |
32 | 40 | "env": {
|
33 | 41 | "browser": true,
|
34 | 42 | "node": true
|
|
42 | 50 | "semi": true,
|
43 | 51 | "singleQuote": false,
|
44 | 52 | "printWidth": 100,
|
45 |
| - "endOfLine": "auto" |
| 53 | + "endOfLine": "auto", |
| 54 | + "trailingComma": "none" |
46 | 55 | }],
|
47 | 56 | "node/no-unsupported-features/es-syntax": "off",
|
48 | 57 | "node/no-missing-import": "off",
|
| 58 | + "comma-dangle": "off", |
49 | 59 | "no-console": "error",
|
50 | 60 | "no-undef": "error",
|
51 | 61 | "no-restricted-globals": ["error", "event", "self"],
|
|
58 | 68 | "no-unsafe-negation": ["error"],
|
59 | 69 | "no-duplicate-imports": ["error"],
|
60 | 70 | "valid-typeof": ["error"],
|
61 |
| - "no-unused-vars": ["error", { "vars": "all", "args": "none", "ignoreRestSiblings": false, "caughtErrors": "all" }], |
| 71 | + "@typescript-eslint/no-unused-vars": ["error", { "vars": "all", "args": "none", "ignoreRestSiblings": false, "caughtErrors": "all" }], |
62 | 72 | "curly": ["error", "all"],
|
63 | 73 | "no-restricted-syntax": ["error", "PrivateIdentifier"],
|
64 | 74 | "prefer-const": ["error", {
|
65 | 75 | "destructuring": "all",
|
66 | 76 | "ignoreReadBeforeAssign": true
|
67 | 77 | }]
|
| 78 | + }, |
| 79 | + "globals": { |
| 80 | + "NodeJS": "readonly" |
68 | 81 | }
|
69 | 82 | }
|
0 commit comments