forked from BrunchVendor/cj-parser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
37 lines (36 loc) · 996 Bytes
/
.eslintrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
const { defineConfig } = require('eslint-define-config')
const path = require('path')
module.exports = defineConfig({
env: {
browser: true,
es2022: true,
node: true,
},
extends: [
'airbnb-base',
'airbnb-typescript/base',
],
parserOptions: {
// 配置 TypeScript 解析器
parser: '@typescript-eslint/parser',
// 通过 tsconfig 文件确定解析范围,这里需要绝对路径,否则子模块中 eslint 会出现异常
project: path.resolve(__dirname, 'tsconfig.eslint.json'),
ecmaVersion: 13,
sourceType: 'module',
},
rules: {
// import
'import/no-extraneous-dependencies': 'off',
'import/prefer-default-export': 'off',
// typescript
'@typescript-eslint/semi': ['warn', 'never'],
// eslint
'linebreak-style': 'off',
'no-console': 'off',
'no-param-reassign': 'off',
'no-continue': 'off',
'no-plusplus': 'off',
'prefer-destructuring': 'off',
'no-restricted-syntax': 'off',
},
})