Skip to content
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

Merged
merged 43 commits into from
Nov 21, 2024

Conversation

dimaMachina
Copy link
Collaborator

fixes #2103
cc @bmulholland

Copy link

changeset-bot bot commented Nov 20, 2024

🦋 Changeset detected

Latest commit: 253e17c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@graphql-eslint/eslint-plugin Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

processorVueBlocks({
blocks: {
styles: false,
customBlocks: true,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should I remove processing custom blocks? @bmulholland

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't even know you could do that! They sound cool... and like something that should be out of scope for now.

They're custom, so you'd want to pretty careful with the scenario. Best for someone to have the need and share what it is in more detail. That would probably be a very long tail thing though... honestly probably can always ignore.

@@ -2,8 +2,6 @@
<span>test</span>
</template>
<script>
/* eslint-disable no-unused-vars */
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only found one bug, can't understand but the ESLint directives no longer works in script tags

If I have this directive I have

image

If I remove

image

Copy link
Contributor

Choose a reason for hiding this comment

The 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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did that work?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The 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)

@dimaMachina dimaMachina changed the title Report lint issues, not on first char of file, for Vue Report lint issues, not on first char of file, for Vue. Support ESLint fixes and suggestions Nov 20, 2024
@dimaMachina dimaMachina mentioned this pull request Nov 20, 2024
12 tasks
@dimaMachina dimaMachina changed the title Report lint issues, not on first char of file, for Vue. Support ESLint fixes and suggestions Fix report lint issues not on first char of file for .vue and support ESLint fixes and suggestions Nov 20, 2024
blocks: {
styles: false,
customBlocks: true,
script: true,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The 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.

@bmulholland
Copy link
Contributor

Oh wow this is really exciting! I'll take a look :)

@bmulholland
Copy link
Contributor

Nice find on that package!

If you think this is ready, I can try it out on my project. I always struggle with trying unpackaged JS libraries (spoiled by Ruby, I suppose). Could I just clone this branch and use pnpm link on the cloned dir? Is there an easier/better way to try it out?

@dimaMachina
Copy link
Collaborator Author

Nice find on that package!

If you think this is ready, I can try it out on my project. I always struggle with trying unpackaged JS libraries (spoiled by Ruby, I suppose). Could I just clone this branch and use pnpm link on the cloned dir? Is there an easier/better way to try it out?

graphql-eslint needs a new alpha release to try it out, I will do it in few minutes with bug fix

you will need just update your project according new vue example

@dimaMachina dimaMachina changed the base branch from upd-components-v8 to master November 21, 2024 20:20
Copy link
Contributor

💻 Website Preview

The latest changes are available as preview in: https://2277a208.graphql-eslint.pages.dev

@dimaMachina dimaMachina merged commit ccd9303 into master Nov 21, 2024
7 of 8 checks passed
@dimaMachina dimaMachina deleted the better-vue-processor branch November 21, 2024 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Report lint issues inline, not on first char of file, for Vue and Svelte
2 participants