1.0.0 • Published 2 years ago
@paint-hub/eslint-config-nuxt v1.0.0
@paint-hub/eslint-config-nuxt
适用于 NuxtJS 的 ESlint 配置
🏁 安装
npm install @paint-hub/eslint-config-nuxt --save-dev
# or
pnpm add @paint-hub/eslint-config-nuxt -D
🚋 使用
// .eslintrc.js
module.exports = {
extends: ['@paint-hub/nuxt'],
}
🛠️ 预设规则
以下展示的是默认规则,你可以在你的 .eslintrc.js
中覆盖或添加规则
env: {
browser: true,
node: true,
es2022: true,
},
parserOptions: {
parser: '@babel/eslint-parser',
sourceType: 'module',
},
extends: [
'plugin:vue/essential',
'plugin:vue/strongly-recommended',
'plugin:vue/recommended',
'@nuxtjs',
'plugin:nuxt/recommended',
'plugin:@paint-hub/specification/base',
'plugin:prettier/recommended',
'eslint:recommended',
'prettier',
],
plugins: ['vue', 'nuxt', 'prettier', '@paint-hub/specification'],
rules: {
'vue/html-self-closing': [
'error',
{
html: {
void: 'always',
normal: 'never',
component: 'always',
},
svg: 'always',
math: 'always',
},
],
'vue/max-attributes-per-line': 'off',
'vue/singleline-html-element-content-newline': 'off',
'vue/no-v-html': 'off',
'vue/multi-word-component-names': 'off',
'no-console': 'off',
},
overrides: [
{
files: ['**/tests/unit/**/*.spec.{j,t}s?(x)'],
env: {
jest: true,
},
},
],
License
Copyright (c) 2022-present, Wenhao (Noah) Yu
1.0.0
2 years ago