diff --git a/.changeset/fast-fishes-shake.md b/.changeset/fast-fishes-shake.md
new file mode 100644
index 00000000000..b867f15b5ad
--- /dev/null
+++ b/.changeset/fast-fishes-shake.md
@@ -0,0 +1,5 @@
+---
+'@graphql-eslint/eslint-plugin': patch
+---
+
+fix reporting lint issues not on first char of file for `.vue` and support ESLint fixes and suggestions for them. Use [new official example](https://github.com/dimaMachina/graphql-eslint/blob/master/examples/vue-code-file/eslint.config.js)
diff --git a/examples/vue-code-file/eslint.config.js b/examples/vue-code-file/eslint.config.js
index d4c93c8b4bc..39bd26547b5 100644
--- a/examples/vue-code-file/eslint.config.js
+++ b/examples/vue-code-file/eslint.config.js
@@ -1,18 +1,30 @@
-import vueParser from 'vue-eslint-parser';
+import { mergeProcessors } from 'eslint-merge-processors';
+import pluginVue from 'eslint-plugin-vue';
+import processorVueBlocks from 'eslint-processor-vue-blocks';
import js from '@eslint/js';
import graphqlPlugin from '@graphql-eslint/eslint-plugin';
export default [
{
- files: ['**/*.js', '**/*.vue'],
+ files: ['**/*.js'],
processor: graphqlPlugin.processor,
rules: js.configs.recommended.rules,
},
+ ...pluginVue.configs['flat/recommended'],
{
files: ['**/*.vue'],
- languageOptions: {
- parser: vueParser,
- },
+ // `eslint-plugin-vue` will set a default processor for `.vue` files
+ // we use `eslint-merge-processors` to extend it
+ processor: mergeProcessors([
+ pluginVue.processors.vue,
+ processorVueBlocks({
+ blocks: {
+ script: true,
+ scriptSetup: true,
+ customBlocks: true,
+ },
+ }),
+ ]),
},
{
files: ['**/*.graphql'],
diff --git a/examples/vue-code-file/package.json b/examples/vue-code-file/package.json
index 6a1efbe91ff..4bb097d8f8e 100644
--- a/examples/vue-code-file/package.json
+++ b/examples/vue-code-file/package.json
@@ -12,8 +12,9 @@
},
"devDependencies": {
"@graphql-eslint/eslint-plugin": "workspace:*",
- "@vue/compiler-sfc": "3.5.13",
"eslint": "9.14.0",
- "vue-eslint-parser": "9.4.3"
+ "eslint-merge-processors": "^0.1.0",
+ "eslint-plugin-vue": "^9.31.0",
+ "eslint-processor-vue-blocks": "^0.1.2"
}
}
diff --git a/examples/vue-code-file/test.vue b/examples/vue-code-file/test.vue
index d666f4e5cc7..60194b815e5 100644
--- a/examples/vue-code-file/test.vue
+++ b/examples/vue-code-file/test.vue
@@ -1,9 +1,9 @@
- test
+
+ {{ GET_USER }}
+ {{ GET_ANOTHER_USER }}