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

Create a separate staged ESLint ruleset #9975

Open
1 task
benbowler opened this issue Jan 6, 2025 · 1 comment
Open
1 task

Create a separate staged ESLint ruleset #9975

benbowler opened this issue Jan 6, 2025 · 1 comment

Comments

@benbowler
Copy link
Collaborator

Feature Description

In 9043 we added the ability to define staging ESLint rules that only apply to newly committed files through husky, to avoid having to complete large refactors when adding new rules.

Currently staged rules are added to the main eslint-plugin-sitekit which means we have to disable the rules in the main ruleset for every staged rule.

site-kit-wp/.eslintrc.json

Lines 181 to 182 in 3fb6f47

"sitekit/no-direct-date": "off",
"sitekit/no-storybook-scenario-label": "off"

Instead we could create a separate ruleset (eg. eslint-plugin-sitekit-staging) that is only brought into the .eslintrc.staged.json config and applied to new changes.


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

Implementation Brief

Test Coverage

QA Brief

Changelog entry

@benbowler
Copy link
Collaborator Author

Another thing to possibly consider here or in a new ticket is that the staged rules don't currently get highlighted within VSCode for me because of how it detects the ruleset. It would be good to be able to see staged rules in the editor to catch them early during coding.

Although developers use different setups so perhaps this is out of scope of core plugin changes and down to each developer to configure.

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

No branches or pull requests

1 participant