File tree Expand file tree Collapse file tree 6 files changed +1296
-34
lines changed Expand file tree Collapse file tree 6 files changed +1296
-34
lines changed Original file line number Diff line number Diff line change 1
- module . exports = {
1
+ export default {
2
2
extends : [ '@commitlint/config-conventional' ] ,
3
3
rules : {
4
- // type 类型定义,表示 git 提交的 type 必须在以下类型范围内
5
4
'type-enum' : [
6
5
2 ,
7
6
'always' ,
8
7
[
9
- 'feat' , // 新功能
10
- 'fix' , // 修复
11
- 'docs' , // 文档变更
12
- 'style' , // 代码格式
13
- 'refactor' , // 重构
14
- 'perf' , // 性能优化
15
- 'test' , // 增加测试
16
- 'build' , // 构建
17
- 'ci' , // CI配置
18
- 'chore' , // 构建过程或辅助工具的变动
19
- 'revert' , // 回退
20
- 'build' , // 打包
21
- 'release' , // 发版
8
+ 'feat' ,
9
+ 'fix' ,
10
+ 'docs' ,
11
+ 'style' ,
12
+ 'refactor' ,
13
+ 'perf' ,
14
+ 'test' ,
15
+ 'build' ,
16
+ 'ci' ,
17
+ 'chore' ,
18
+ 'revert' ,
19
+ 'build' ,
20
+ 'release' ,
22
21
] ,
23
22
] ,
24
- // subject 大小写不做校验
25
23
'subject-case' : [ 0 ] ,
26
24
} ,
27
25
}
Original file line number Diff line number Diff line change 1
- // import tseslint from 'typescript-eslint';
2
- // import prettierPlugin from 'eslint-plugin-prettier';
3
- const tseslint = require ( 'typescript-eslint' ) ;
4
- const prettierPlugin = require ( 'eslint-plugin-prettier' ) ;
1
+ import tsParser from '@typescript-eslint/parser'
2
+ import tseslint from 'typescript-eslint' ;
3
+ import tsPlugin from '@typescript-eslint/eslint-plugin'
4
+ import importPlugin from 'eslint-plugin-import'
5
+ import prettierPlugin from 'eslint-plugin-prettier' ;
6
+ import globals from 'globals'
5
7
6
- module . exports = [
7
- // 应用 TypeScript ESLint 推荐配置
8
+ export default [
8
9
...tseslint . configs . recommended ,
9
10
10
11
{
@@ -16,24 +17,20 @@ module.exports = [
16
17
ignores : [ 'config/**/*.{js,ts}' ] ,
17
18
} ,
18
19
19
- // 全局配置
20
20
{
21
21
files : [ 'packages/**/*.{js,ts}' ] ,
22
22
23
23
languageOptions : {
24
- ecmaVersion : 2020 ,
25
- sourceType : 'module' ,
24
+ parser : tsParser ,
26
25
parserOptions : {
27
- ecmaVersion : 2020 ,
26
+ ecmaVersion : 'latest' ,
28
27
sourceType : 'module' ,
29
28
} ,
30
29
globals : {
31
- // 浏览器环境
32
- window : 'readonly' ,
33
- document : 'readonly' ,
34
- navigator : 'readonly' ,
35
- // Chrome 扩展 API
36
- chrome : 'readonly' ,
30
+ ...globals . es2022 ,
31
+ ...globals . node ,
32
+ ...globals . browser ,
33
+ ...globals . devtools ,
37
34
} ,
38
35
} ,
39
36
@@ -46,6 +43,8 @@ module.exports = [
46
43
} ,
47
44
48
45
plugins : {
46
+ '@typescript-eslint' : tsPlugin ,
47
+ import : importPlugin ,
49
48
prettier : prettierPlugin ,
50
49
} ,
51
50
} ,
Original file line number Diff line number Diff line change 1
- module . exports = {
1
+ export default {
2
2
'packages/**/*.{ts,js}' : [ 'npx eslint' ] ,
3
3
}
Original file line number Diff line number Diff line change 2
2
"name" : " vue-devtools-unlocker" ,
3
3
"version" : " 1.0.0" ,
4
4
"description" : " Enable Vue DevTools in production environments" ,
5
+ "type" : " module" ,
5
6
"author" : " zhensherlock" ,
6
7
"license" : " MIT" ,
7
8
"scripts" : {
29
30
"@commitlint/cli" : " ^19.8.1" ,
30
31
"@commitlint/config-conventional" : " ^19.8.1" ,
31
32
"@types/chrome" : " ^0.1.4" ,
33
+ "@typescript-eslint/eslint-plugin" : " ^8.42.0" ,
32
34
"@typescript-eslint/parser" : " ^8.41.0" ,
33
35
"adm-zip" : " ^0.5.16" ,
34
36
"copy-webpack-plugin" : " ^13.0.1" ,
35
37
"css-loader" : " ^7.1.2" ,
36
38
"eslint" : " ^9.34.0" ,
39
+ "eslint-plugin-import" : " ^2.32.0" ,
37
40
"eslint-plugin-prettier" : " ^5.5.4" ,
38
41
"file-loader" : " ^6.2.0" ,
42
+ "globals" : " ^16.3.0" ,
39
43
"husky" : " ^9.1.7" ,
40
44
"mini-css-extract-plugin" : " ^2.9.4" ,
41
45
"prettier" : " ^3.6.2" ,
You can’t perform that action at this time.
0 commit comments