-
Notifications
You must be signed in to change notification settings - Fork 108
Fix report lint issues not on first char of file for .vue
and support ESLint fixes and suggestions
#2735
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix report lint issues not on first char of file for .vue
and support ESLint fixes and suggestions
#2735
Changes from all commits
20dd47d
6772e70
ab18555
0a153a9
d11846f
7e92103
2a72f5d
8d6f413
24b1c7f
c01f82e
b667b1f
62e0e17
20a864d
06be501
7c231d4
af3406b
3622a37
57928e2
6ab54ef
9b1bf71
1683055
c0a6fe2
a168de8
1b43738
16f4e86
45cc040
7c7011c
30191fe
8b8eab0
493bd14
fcb929d
3bff0d1
6b27f22
d1721cf
e0d9a8b
6c3f049
eb630e8
0169353
13db26f
dde6dd8
dac487b
d70923c
253e17c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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([ | ||
dimaMachina marked this conversation as resolved.
Show resolved
Hide resolved
|
||
pluginVue.processors.vue, | ||
processorVueBlocks({ | ||
blocks: { | ||
script: true, | ||
scriptSetup: true, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also what about this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Script setup is essentially the new standard, best practice way to write Vue components. Almost all my code is in that, or migrating to it. Should certainly be supported. |
||
customBlocks: true, | ||
}, | ||
}), | ||
]), | ||
}, | ||
{ | ||
files: ['**/*.graphql'], | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
<template> | ||
<span>test</span> | ||
<!-- use the variables to satisfy the no-unused-vars lint --> | ||
<span>{{ GET_USER }}</span> | ||
<span>{{ GET_ANOTHER_USER }}</span> | ||
</template> | ||
<script> | ||
/* eslint-disable no-unused-vars */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah it wouldn't be the first time I see a lint disabling a rule and also disabling the unused-directive check hah. You could easily just use the variables, though. I'll post code above. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did that work? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nope, because it's upstream issue from merge-processors antfu/eslint-processor-vue-blocks#8 (comment) |
||
|
||
const GET_USER = /* GraphQL */ ` | ||
query { | ||
user { | ||
|
Uh oh!
There was an error while loading. Please reload this page.