Skip to content

Commit

Permalink
feat: update plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
CyanSalt committed Oct 29, 2021
1 parent 3c3238d commit 208c4dc
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 21 deletions.
2 changes: 2 additions & 0 deletions base.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ module.exports = {
'no-shadow': ['error', { hoist: 'functions' }],
// 自动删除变量的 undefined 初始值
'no-undef-init': 'warn',
// 禁止定义未使用的私有类成员
'no-unused-private-class-members': 'error',
// [覆盖 recommended] 禁止定义未使用的变量,除了剩余参数和解构
'no-unused-vars': ['error', { args: 'none', ignoreRestSiblings: true }],
// 禁止定义前使用变量(ReferenceError)
Expand Down
19 changes: 11 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
"author": "CyanSalt",
"license": "ISC",
"peerDependencies": {
"eslint": "^8.0.0"
"eslint": "^8.1.0"
},
"devDependencies": {
"@release-it/conventional-changelog": "^3.3.0",
"eslint": "^8.0.1",
"eslint": "8.1.0",
"release-it": "^14.11.6"
},
"dependencies": {
Expand Down
10 changes: 5 additions & 5 deletions plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@
}
},
"@typescript-eslint/eslint-plugin": {
"version": "5.1.0",
"version": "5.2.0",
"requires": {
"typescript": "*"
}
},
"@typescript-eslint/parser": {
"version": "5.1.0",
"version": "5.2.0",
"requires": {
"typescript": "*"
}
},
"eslint": {
"version": "8.0.1"
"version": "8.1.0"
},
"eslint-plugin-galaxy": {
"version": "1.7.1"
"version": "1.8.0"
},
"eslint-plugin-import": {
"version": "2.25.2"
Expand All @@ -42,7 +42,7 @@
"version": "37.0.1"
},
"eslint-plugin-vue": {
"version": "7.20.0",
"version": "8.0.1",
"requires": {
"vue": "*"
}
Expand Down
2 changes: 2 additions & 0 deletions typescript/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ module.exports = {
}],
// 自动替换 type 对象类型为 interface
'@typescript-eslint/consistent-type-definitions': ['warn', 'interface'],
// 自动将类型导出放置在 export type 语句中
'@typescript-eslint/consistent-type-exports': 'warn',
// 自动将类型引用放置在 import type 语句中
'@typescript-eslint/consistent-type-imports': ['warn', { prefer: 'type-imports' }],
// 自动省略 public 成员修饰符
Expand Down
8 changes: 2 additions & 6 deletions vue/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ module.exports = {
'vue/component-name-in-template-casing': ['warn', 'PascalCase', { registeredComponentsOnly: true }],
// 组件的 name 必须与文件名匹配
'vue/match-component-file-name': ['error', { extensions: ['vue'], shouldMatchCase: true }],
// 自动修复已废弃的 v-is 指令
'vue/no-deprecated-v-is': 'warn',
// 使用 v-bind="$attrs" 时必须指定 inheritAttrs: false
'vue/no-duplicate-attr-inheritance': 'error',
// 禁止单文件组件内的空标签
Expand All @@ -91,8 +89,6 @@ module.exports = {
}],
// 自动去除不必要的 Mustache 插值
'vue/no-useless-mustaches': 'warn',
// 禁止无用的 template 属性
'vue/no-useless-template-attributes': 'error',
// 自动去除不必要的 v-bind 绑定
'vue/no-useless-v-bind': 'warn',
// 自动在单文件组件的根元素之间加入换行
Expand All @@ -101,8 +97,6 @@ module.exports = {
'vue/require-emit-validator': 'error',
// 自动将 v-for 中的 of 替换为 in 以保持一致
'vue/v-for-delimiter-style': 'warn',
// 自动修复错误的 nextTick 用例
'vue/valid-next-tick': 'warn',

/** Extension Rules */
// 自动优化数组的两侧括号换行(前括号和后括号保持一致)
Expand Down Expand Up @@ -137,6 +131,8 @@ module.exports = {
'vue/no-empty-pattern': 'error',
// 禁止使用非标准空白符(ESLint recommended)
'vue/no-irregular-whitespace': 'error',
// 禁止使用 JS 不支持的数字精度(ESLint recommended)
'vue/no-loss-of-precision': 'error',
// 禁止使用稀疏数组(ESLint recommended)
'vue/no-sparse-arrays': 'error',
// 禁止单行内的字符串字面量拼接
Expand Down

0 comments on commit 208c4dc

Please sign in to comment.