Skip to content

feat: introduce -error versions of configs that have all rules configured to error #2796

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

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

G-Rath
Copy link
Contributor

@G-Rath G-Rath commented Jul 15, 2025

I'm happy to take alternative names for the environment and local config variables

Resolves #2774

Copy link

changeset-bot bot commented Jul 15, 2025

🦋 Changeset detected

Latest commit: 168cf66

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

This PR includes changesets to release 1 package
Name Type
eslint-plugin-vue Minor

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

@G-Rath G-Rath force-pushed the support-erroring branch 4 times, most recently from 1d9181a to c26aeb9 Compare July 31, 2025 20:11
@G-Rath
Copy link
Contributor Author

G-Rath commented Jul 31, 2025

@waynzh would it be possible to get a review or even just a yay/nay on if you're open to this?

@FloEdelmann
Copy link
Member

I'm unsure whether an environment variable is the correct approach to this. Maybe it would be better to duplicate the configs with an -error variant for each one?

@G-Rath
Copy link
Contributor Author

G-Rath commented Aug 6, 2025

I'm personally not fussed so if you're happy having double the amount of configs I'm fine to do it that way too - I just figured the env variable was a nice way of leveraging the fact that going forward you have to use a JS file for the ESLint config (meaning its always possible to ensure that the property on process.env is always set when ESLint is running) without doing a breaking change

@FloEdelmann
Copy link
Member

@ota-meshi @waynzh What do you think?

@ota-meshi
Copy link
Member

I've been thinking about this for a few days, and my personal opinion is that I'm against adding new shareable configs or making major changes to them.
It's impossible to satisfy everyone's preferences, so I think it's better for users to create their own configs.
I think this is also related to #1951 (comment).
However, if @FloEdelmann and @waynzh both think this config change is a good idea, there's no problem with accepting it.

@ota-meshi @waynzh What do you think?

I'm not a fan of using environment variables.

@waynzh
Copy link
Member

waynzh commented Aug 8, 2025

For the IDE DX issue, you can address it by configuring the IDE-ESLint integration like this:

"eslint.rules.customizations": [
  { "rule": "*", "severity": "error" }
  // { "rule": "vue/*", "severity": "error" }
]

I'm not a big fan of controlling this via environment variables either.
One thing worth noting is that there's already a (though not very active) discussion in the ESLint core (eslint/eslint#14679) about adding severity settings into ESLint config. If implemented, this would allow severity to be configured through a single field, removing the need for each plugin to provide separate sharable configs for different severity levels.

@G-Rath
Copy link
Contributor Author

G-Rath commented Aug 8, 2025

For the IDE DX issue, you can address it by configuring the IDE-ESLint integration like this:

That only works for VSCode

I'm not a big fan of controlling this via environment variables either.

Sounds like folks are against that, so I'll switch to generating new configs

Revert "feat: support using `error` instead of `warn` for rules in
config"

This reverts commit efb2832.

Revert "feat: regenerate configs"

This reverts commit a379d77.

Revert "feat: only define variable if it is needed"

This reverts commit be3db8d.

Revert "feat: regenerate rules"

This reverts commit 98888a6.

Revert "docs: add note to user guide"

This reverts commit 3dd94e3.

Revert "fix: avoid unneeded blank line"

This reverts commit d7990e9.
@G-Rath G-Rath force-pushed the support-erroring branch from dc7e408 to a2795d8 Compare August 8, 2025 04:15
@G-Rath G-Rath force-pushed the support-erroring branch from a2795d8 to 3825a40 Compare August 8, 2025 04:31
@G-Rath
Copy link
Contributor Author

G-Rath commented Aug 8, 2025

@FloEdelmann @waynzh @ota-meshi I've updated the implementation to generate dedicated configs instead of using an env variable

@G-Rath G-Rath changed the title feat: support having all rules in config report at error instead of warn using env variable feat: introduce -error versions of configs that have all rules configured to error Aug 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow having all rules error instead of warn
4 participants