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

Add suggestions to vue/no-export-in-script-setup #2690

Open
chouchouji opened this issue Feb 21, 2025 · 1 comment
Open

Add suggestions to vue/no-export-in-script-setup #2690

chouchouji opened this issue Feb 21, 2025 · 1 comment

Comments

@chouchouji
Copy link
Contributor

chouchouji commented Feb 21, 2025

Tell us about your environment

  • ESLint version: 8.44.0
  • eslint-plugin-vue version: 9.17.0
  • Vue version: 3.3.4
  • Node version: 18.17.0

The problem you want to solve.

Can we add fixer to autofix this code for vue/no-export-in-script-setup rule?

Image

Your take on the correct solution to problem.

Additional context

If you think so, I am pleased to submit a pr. Thanks!

@FloEdelmann
Copy link
Member

FloEdelmann commented Mar 5, 2025

In #2701, the rule was already improved to only report the export keyword for statements that might be relevant for local code, e.g.:

export const foo = 'bar'
console.log(foo)

As a potential follow-up improvement, a PR would be welcome that adds suggestions that remove the reported code (i.e. the whole statement for export * from 'foo' and only the export keyword for export const foo = 'bar'). For more context, see #2701 (comment).

Autofixes are considered too dangerous for this rule to break other code.

@FloEdelmann FloEdelmann changed the title [Enhancement] Add fixer for vue/no-export-in-script-setup to support autofix Add suggestions to vue/no-export-in-script-setup Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants