@vedmant/eslint-plugin
v1.1.0
Published
ESLint rules for Vue and other conventions used by vedmant.
Maintainers
Readme
@vedmant/eslint-plugin
ESLint rules used in vedmant projects. Currently includes layout rules for Vue single-file components.
Install
yarn add -D @vedmant/eslint-pluginPeer dependencies (install these if not already present):
eslint^8.57.0,^9.0.0, or^10.0.0vue-eslint-parser>=9.0.0
Usage (ESLint flat config)
// eslint.config.js
const vueEslintParser = require('vue-eslint-parser')
const vedmantEslintPlugin = require('@vedmant/eslint-plugin')
module.exports = [
{
files: ['**/*.vue'],
languageOptions: {
parser: vueEslintParser,
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
},
plugins: {
'@vedmant': vedmantEslintPlugin,
},
// Do NOT add a processor here — vue-eslint-parser must be the active parser
// for template visitors (defineTemplateBodyVisitor) to work.
rules: {
'@vedmant/vue-start-tag-single-line': 'error',
},
},
]Rule options
@vedmant/vue-start-tag-single-line — prefer a single-line opening tag when the attribute count and compact line length are within limits.
maxAttributes(default5) — only suggest one line when there are at most this many attributes.maxLineLength(default300) — only report when the collapsed tag fits within this many characters.
Example:
'@vedmant/vue-start-tag-single-line': ['error', { maxAttributes: 5, maxLineLength: 120 }]Development
yarn install
yarn testLicense
MIT
