Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 14 additions & 16 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
module.exports = {
export default {
extends: ['@commitlint/config-conventional'],
rules: {
// type 类型定义,表示 git 提交的 type 必须在以下类型范围内
'type-enum': [
2,
'always',
[
'feat', // 新功能
'fix', // 修复
'docs', // 文档变更
'style', // 代码格式
'refactor', // 重构
'perf', // 性能优化
'test', // 增加测试
'build', // 构建
'ci', // CI配置
'chore', // 构建过程或辅助工具的变动
'revert', // 回退
'build', // 打包
'release', // 发版
'feat',
'fix',
'docs',
'style',
'refactor',
'perf',
'test',
'build',
'ci',
'chore',
'revert',
'build',
'release',
],
],
// subject 大小写不做校验
'subject-case': [0],
},
}
31 changes: 15 additions & 16 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// import tseslint from 'typescript-eslint';
// import prettierPlugin from 'eslint-plugin-prettier';
const tseslint = require('typescript-eslint');
const prettierPlugin = require('eslint-plugin-prettier');
import tsParser from '@typescript-eslint/parser'
import tseslint from 'typescript-eslint';
import tsPlugin from '@typescript-eslint/eslint-plugin'
import importPlugin from 'eslint-plugin-import'
import prettierPlugin from 'eslint-plugin-prettier';
import globals from 'globals'

module.exports = [
// 应用 TypeScript ESLint 推荐配置
export default [
...tseslint.configs.recommended,

{
Expand All @@ -16,24 +17,20 @@ module.exports = [
ignores: ['config/**/*.{js,ts}'],
},

// 全局配置
{
files: ['packages/**/*.{js,ts}'],

languageOptions: {
ecmaVersion: 2020,
sourceType: 'module',
parser: tsParser,
parserOptions: {
ecmaVersion: 2020,
ecmaVersion: 'latest',
sourceType: 'module',
},
globals: {
// 浏览器环境
window: 'readonly',
document: 'readonly',
navigator: 'readonly',
// Chrome 扩展 API
chrome: 'readonly',
...globals.es2022,
...globals.node,
...globals.browser,
...globals.devtools,
},
},

Expand All @@ -46,6 +43,8 @@ module.exports = [
},

plugins: {
'@typescript-eslint': tsPlugin,
import: importPlugin,
prettier: prettierPlugin,
},
},
Expand Down
2 changes: 1 addition & 1 deletion lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
export default {
'packages/**/*.{ts,js}': ['npx eslint'],
}
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "vue-devtools-unlocker",
"version": "1.0.0",
"description": "Enable Vue DevTools in production environments",
"type": "module",
"author": "zhensherlock",
"license": "MIT",
"scripts": {
Expand Down Expand Up @@ -29,13 +30,16 @@
"@commitlint/cli": "^19.8.1",
"@commitlint/config-conventional": "^19.8.1",
"@types/chrome": "^0.1.4",
"@typescript-eslint/eslint-plugin": "^8.42.0",
"@typescript-eslint/parser": "^8.41.0",
"adm-zip": "^0.5.16",
"copy-webpack-plugin": "^13.0.1",
"css-loader": "^7.1.2",
"eslint": "^9.34.0",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-prettier": "^5.5.4",
"file-loader": "^6.2.0",
"globals": "^16.3.0",
"husky": "^9.1.7",
"mini-css-extract-plugin": "^2.9.4",
"prettier": "^3.6.2",
Expand Down
Loading