|
1 |
| -{ |
2 |
| - "root": true, |
3 |
| - "extends": [ |
4 |
| - "eslint:recommended", |
5 |
| - "plugin:jsdoc/recommended", |
6 |
| - "plugin:@typescript-eslint/recommended" |
| 1 | +const eslint = require('@eslint/js'); |
| 2 | +const tseslint = require('typescript-eslint'); |
| 3 | +const jsdoc = require('eslint-plugin-jsdoc'); |
| 4 | + |
| 5 | +module.exports = tseslint.config({ |
| 6 | + files: ['**/*.js', '**/*.ts'], |
| 7 | + extends: [ |
| 8 | + eslint.configs.recommended, |
| 9 | + ...tseslint.configs.recommended, |
7 | 10 | ],
|
8 |
| - "env": { |
9 |
| - "node": true, |
10 |
| - "es6": true |
11 |
| - }, |
12 |
| - "parser": "@typescript-eslint/parser", |
13 |
| - "globals": { |
14 |
| - "wx": true |
15 |
| - }, |
16 |
| - "plugins": [ |
17 |
| - "jsdoc", |
18 |
| - "@typescript-eslint" |
19 |
| - ], |
20 |
| - "parserOptions": { |
21 |
| - "ecmaVersion": 6, |
22 |
| - "sourceType": "module", |
23 |
| - "requireConfigFile": false |
| 11 | + plugins: { |
| 12 | + '@typescript-eslint': tseslint.plugin, |
| 13 | + jsdoc, |
24 | 14 | },
|
25 | 15 | "rules": {
|
26 | 16 | "indent": ["error", 2],
|
|
34 | 24 | "no-useless-escape": "off",
|
35 | 25 | "no-var": "error",
|
36 | 26 | "no-console": 0,
|
37 |
| - "no-prototype-builtins": "off", |
38 | 27 | "require-atomic-updates": "off",
|
39 | 28 | "prefer-spread": "off",
|
40 | 29 | "prefer-rest-params": "off",
|
|
44 | 33 | "@typescript-eslint/no-explicit-any": "off",
|
45 | 34 | "@typescript-eslint/no-var-requires": "off",
|
46 | 35 | "@typescript-eslint/no-non-null-assertion": "off",
|
| 36 | + "@typescript-eslint/no-require-imports": "off", |
| 37 | + "@typescript-eslint/no-unused-vars": [ |
| 38 | + "error", |
| 39 | + { |
| 40 | + "args": "all", |
| 41 | + "argsIgnorePattern": "^_", |
| 42 | + "caughtErrors": "all", |
| 43 | + "caughtErrorsIgnorePattern": "^_", |
| 44 | + "destructuredArrayIgnorePattern": "^_", |
| 45 | + "varsIgnorePattern": "^_", |
| 46 | + "ignoreRestSiblings": true |
| 47 | + } |
| 48 | + ], |
47 | 49 | "jsdoc/require-jsdoc": 0,
|
48 | 50 | "jsdoc/require-returns-description": 0,
|
49 | 51 | "jsdoc/require-param-description": 0,
|
|
67 | 69 | ]
|
68 | 70 | }
|
69 | 71 | ]
|
70 |
| - } |
71 |
| -} |
| 72 | + }, |
| 73 | + languageOptions: { |
| 74 | + parser: tseslint.parser, |
| 75 | + globals: { |
| 76 | + __dirname: true, |
| 77 | + beforeEach: true, |
| 78 | + Buffer: true, |
| 79 | + console: true, |
| 80 | + describe: true, |
| 81 | + fail: true, |
| 82 | + expect: true, |
| 83 | + global: true, |
| 84 | + it: true, |
| 85 | + jasmine: true, |
| 86 | + process: true, |
| 87 | + spyOn: true, |
| 88 | + }, |
| 89 | + }, |
| 90 | +}); |
0 commit comments