refactor: rename folders
This commit is contained in:
110
packages/eslint-config-vue/index.js
Normal file
110
packages/eslint-config-vue/index.js
Normal file
@@ -0,0 +1,110 @@
|
||||
const { isPackageExists } = require('local-pkg')
|
||||
|
||||
const TS = isPackageExists('typescript')
|
||||
|
||||
if (!TS)
|
||||
console.warn('[@antfu/eslint-config] TypeScript is not installed, fallback to JS only.')
|
||||
|
||||
module.exports = {
|
||||
overrides: [
|
||||
{
|
||||
files: ['*.vue'],
|
||||
parser: 'vue-eslint-parser',
|
||||
parserOptions: {
|
||||
parser: '@typescript-eslint/parser',
|
||||
},
|
||||
rules: {
|
||||
'no-unused-vars': 'off',
|
||||
'no-undef': 'off',
|
||||
...(TS
|
||||
? { '@typescript-eslint/no-unused-vars': 'off' }
|
||||
: null),
|
||||
},
|
||||
},
|
||||
],
|
||||
extends: [
|
||||
'plugin:vue/vue3-recommended',
|
||||
TS
|
||||
? '@antfu/eslint-config-ts'
|
||||
: '@antfu/eslint-config-basic',
|
||||
],
|
||||
rules: {
|
||||
'vue/max-attributes-per-line': 'off',
|
||||
'vue/no-v-html': 'off',
|
||||
'vue/require-prop-types': 'off',
|
||||
'vue/require-default-prop': 'off',
|
||||
'vue/multi-word-component-names': 'off',
|
||||
'vue/prefer-import-from-vue': 'off',
|
||||
'vue/no-v-text-v-html-on-component': 'off',
|
||||
|
||||
// reactivity transform
|
||||
'vue/no-setup-props-destructure': 'off',
|
||||
|
||||
'vue/component-tags-order': ['error', {
|
||||
order: ['script', 'template', 'style'],
|
||||
}],
|
||||
'vue/block-tag-newline': ['error', {
|
||||
singleline: 'always',
|
||||
multiline: 'always',
|
||||
}],
|
||||
'vue/component-name-in-template-casing': ['error', 'PascalCase'],
|
||||
'vue/component-options-name-casing': ['error', 'PascalCase'],
|
||||
'vue/custom-event-name-casing': ['error', 'camelCase'],
|
||||
'vue/define-macros-order': ['error', {
|
||||
order: ['defineProps', 'defineEmits'],
|
||||
}],
|
||||
'vue/html-comment-content-spacing': ['error', 'always', {
|
||||
exceptions: ['-'],
|
||||
}],
|
||||
'vue/no-restricted-v-bind': ['error', '/^v-/'],
|
||||
'vue/no-useless-v-bind': 'error',
|
||||
'vue/no-unused-refs': 'error',
|
||||
'vue/padding-line-between-blocks': ['error', 'always'],
|
||||
'vue/prefer-separate-static-class': 'error',
|
||||
|
||||
// extensions
|
||||
'vue/array-bracket-spacing': ['error', 'never'],
|
||||
'vue/arrow-spacing': ['error', { before: true, after: true }],
|
||||
'vue/block-spacing': ['error', 'always'],
|
||||
'vue/brace-style': ['error', 'stroustrup', { allowSingleLine: true }],
|
||||
'vue/comma-dangle': ['error', 'always-multiline'],
|
||||
'vue/comma-spacing': ['error', { before: false, after: true }],
|
||||
'vue/comma-style': ['error', 'last'],
|
||||
'vue/dot-location': ['error', 'property'],
|
||||
'vue/dot-notation': ['error', { allowKeywords: true }],
|
||||
'vue/eqeqeq': ['error', 'smart'],
|
||||
// 'vue/func-call-spacing': ['off', 'never'],
|
||||
'vue/key-spacing': ['error', { beforeColon: false, afterColon: true }],
|
||||
'vue/keyword-spacing': ['error', { before: true, after: true }],
|
||||
'vue/no-constant-condition': 'warn',
|
||||
'vue/no-empty-pattern': 'error',
|
||||
'vue/no-extra-parens': ['error', 'functions'],
|
||||
'vue/no-irregular-whitespace': 'error',
|
||||
'vue/no-loss-of-precision': 'error',
|
||||
'vue/no-restricted-syntax': [
|
||||
'error',
|
||||
'DebuggerStatement',
|
||||
'LabeledStatement',
|
||||
'WithStatement',
|
||||
],
|
||||
'vue/no-sparse-arrays': 'error',
|
||||
'vue/object-curly-newline': ['error', { multiline: true, consistent: true }],
|
||||
'vue/object-curly-spacing': ['error', 'always'],
|
||||
'vue/object-property-newline': ['error', { allowMultiplePropertiesPerLine: true }],
|
||||
'vue/object-shorthand': [
|
||||
'error',
|
||||
'always',
|
||||
{
|
||||
ignoreConstructors: false,
|
||||
avoidQuotes: true,
|
||||
},
|
||||
],
|
||||
'vue/operator-linebreak': ['error', 'before'],
|
||||
'vue/prefer-template': 'error',
|
||||
'vue/quote-props': ['error', 'consistent-as-needed'],
|
||||
'vue/space-in-parens': ['error', 'never'],
|
||||
'vue/space-infix-ops': 'error',
|
||||
'vue/space-unary-ops': ['error', { words: true, nonwords: false }],
|
||||
'vue/template-curly-spacing': 'error',
|
||||
},
|
||||
}
|
26
packages/eslint-config-vue/package.json
Normal file
26
packages/eslint-config-vue/package.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"name": "@antfu/eslint-config-vue",
|
||||
"version": "0.37.0",
|
||||
"description": "",
|
||||
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"eslint-config"
|
||||
],
|
||||
"main": "index.js",
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"peerDependencies": {
|
||||
"eslint": ">=7.4.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@antfu/eslint-config-basic": "workspace:*",
|
||||
"@antfu/eslint-config-ts": "workspace:*",
|
||||
"eslint-plugin-vue": "^9.9.0",
|
||||
"local-pkg": "^0.4.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "^8.36.0"
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user