Skip to content

Commit

Permalink
Update Vue parser and processor options
Browse files Browse the repository at this point in the history
  • Loading branch information
niksy committed Nov 23, 2024
1 parent 44c2a55 commit d0453db
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## [Unreleased][]

### Changed

- Vue parser and processor options

## [14.0.1][] - 2024-11-23

### Fixed
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@
"eslint-plugin-unicorn": "^56.0.0",
"eslint-plugin-vue": "^9.31.0",
"globals": "^15.12.0",
"resolve-from": "^5.0.0",
"vue-eslint-parser": "^9.4.3"
"resolve-from": "^5.0.0"
},
"devDependencies": {
"changelog-verify": "^1.1.2",
Expand Down
19 changes: 15 additions & 4 deletions vue.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
import pluginVue from 'eslint-plugin-vue';
import parserVueEslint from 'vue-eslint-parser';

const parserVueEslint = []
.concat(pluginVue.configs['flat/base'])
.reduce((parser, config) => {
if (
config.languageOptions?.parser?.meta?.name === 'vue-eslint-parser'
) {
parser = config.languageOptions.parser;
}
return parser;
}, null);

export default [
{
languageOptions: {
parser: parserVueEslint
},
plugins: {
vue: pluginVue
},
Expand Down Expand Up @@ -358,6 +365,10 @@ export default [
},
{
files: ['**/*.vue'],
languageOptions: {
parser: parserVueEslint
},
processor: pluginVue.processors.vue,
plugins: {
vue: pluginVue
},
Expand Down

0 comments on commit d0453db

Please sign in to comment.