eslint-plugin-vue
eslint-plugin-vue copied to clipboard
`new Vue` is checked by component-related rules
Checklist
- [x] I have tried restarting my IDE and the issue persists.
- [x] I have read the FAQ and my problem is not listed.
Tell us about your environment
- ESLint version: 8.31.0
- eslint-plugin-vue version: 9.9.0
- Node version: 16.16.0
- Operating System: macOS
Please show your full configuration:
module.exports = {
root: true,
extends: ['plugin:vue/vue3-recommended', 'eslint:recommended'],
rules: {
'vue/require-name-property': ['error'],
'vue/padding-lines-in-component-definition': ['error', {
betweenOptions: `always`,
groupSingleLineProperties: false,
}]
},
parserOptions: {
ecmaVersion: 'latest',
},
}
What did you do?
import Vue from 'vue'
import App from './App.vue'
import { createPinia } from 'pinia'
const pinia = createPinia()
new Vue({
pinia,
...App
}).$mount('#app')
What did you expect to happen?
Everything works fine and no error reported since new Vue
is not listed in docs - eslint-detect-components.
What actually happened?
ESLint reported 2 errors:
7:9 error Required name property is not set vue/require-name-property
9:3 error Expected blank line before this definition vue/padding-lines-in-component-definition
Repository to reproduce this issue
https://github.com/ntnyq-dev/repro-eslint-plugin-vue
Related rules
-
vue/require-name-property
-
vue/padding-lines-in-component-definition
- others
Additional
If it is expected, how can I exclude it from being checked?
Thank you for this issue.
It seems to be missing documentation. new Vue()
has been the target of linting since eslint-plugin-vue v3.
If you want to exclude new Vue()
, we'll need to add an option to each rule or fix it.
Thank you for this issue. It seems to be missing documentation.
new Vue()
has been the target of linting since eslint-plugin-vue v3.If you want to exclude
new Vue()
, we'll need to add an option to each rule or fix it.
Can this option be added tovue-eslint-parser
's parserOptions.vueFeatures
so it can be easy configured?
Can this option be added tovue-eslint-parser's parserOptions.vueFeatures so it can be easy configured?
Can not do that. parserOptions.vueFeatures
has nothing to do with linting target detection.