Skip to content

Commit

Permalink
style: @jsxiaosi/eslint-config-vue
Browse files Browse the repository at this point in the history
  • Loading branch information
jsxiaosi committed Oct 16, 2022
1 parent 98fbfa3 commit 4922f8c
Show file tree
Hide file tree
Showing 107 changed files with 1,381 additions and 993 deletions.
62 changes: 1 addition & 61 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,73 +1,13 @@
module.exports = {
root: true,
globals: {
defineProps: 'readonly',
defineEmits: 'readonly',
defineExpose: 'readonly',
withDefaults: 'readonly',
},
env: {
browser: true,
commonjs: true,
es6: true,
node: true,
},
extends: [
'plugin:vue/vue3-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
parser: 'vue-eslint-parser',
parserOptions: {
ecmaVersion: 2020,
parser: '@typescript-eslint/parser',
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
plugins: ['vue'],
extends: ['@jsxiaosi/eslint-config-vue', 'plugin:prettier/recommended'],
rules: {
'prettier/prettier': 'error',
// 是否禁止使用any类型
'@typescript-eslint/no-explicit-any': 'off',
// 是否开启函数必须要指定类型
'@typescript-eslint/explicit-module-boundary-types': 'off',
// 是否禁止使用 @ts-ignore 注解
'@typescript-eslint/ban-ts-comment': 'off',
// 是否禁止空函数
'@typescript-eslint/no-empty-function': 'off',
// 是否禁止使用特定类型
'@typescript-eslint/ban-types': 'off',
// 是否不允许向模板添加多个根节点
'vue/no-multiple-template-root': 'off',
camelcase: 0,
'vue/component-tags-order': [
'error',
{
order: ['template', 'script', 'style'],
},
],
// 是否要求组件名称始终为多字
'vue/multi-word-component-names': [
'off',
{
ignores: ['index', '404'],
},
],
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
'no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
},
};
2 changes: 1 addition & 1 deletion mock/demo/account.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MockMethod, Recordable } from 'vite-plugin-mock';
import type { MockMethod, Recordable } from 'vite-plugin-mock';

const userInfo = {
name: '爱喝蜂蜜绿的小斯斯',
Expand Down
2 changes: 1 addition & 1 deletion mock/demo/route.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MockMethod, Recordable } from 'vite-plugin-mock';
import type { MockMethod, Recordable } from 'vite-plugin-mock';

const power = [
{
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"@commitlint/cli": "^17.0.3",
"@commitlint/config-conventional": "^17.0.3",
"@ehutch79/vite-eslint": "^0.0.1",
"@jsxiaosi/eslint-config-vue": "^0.0.2",
"@types/core-js": "^2.5.5",
"@types/crypto-js": "^4.1.1",
"@types/intro.js": "^5.1.0",
Expand Down
Loading

0 comments on commit 4922f8c

Please sign in to comment.