Skip to content

Add support for eslint v9 #66

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

Merged
merged 4 commits into from
Jul 11, 2024

Conversation

leiit
Copy link
Contributor

@leiit leiit commented Jul 10, 2024

Fixes #62.

Seems that the only reason the current version fails to run using eslint v9 is due to it now enforcing meta.schema to be set for rules that accept options. See https://eslint.org/docs/latest/use/migrate-to-9.0.0#meta-schema-required:

As of ESLint v9.0.0, an error will be thrown if any options are passed to a rule that doesn’t specify meta.schema property.

Since all the exposed rules are actually coming from eslint-plugin-jsx-a11y, which has this metadata available already, simply passing the metadata from there seems to do it.

Additionally, this exposes flatConfigs.recommended & flatConfigs.strict for easier usage, similar to how the main jsx-a11y plugin does this.

leiit added 4 commits July 11, 2024 00:45
eslint v9 requires `meta.schema` to be present if a rule
accepts options.
This allows easier consumption when using flat configs,
similar to how this is done in `eslint-plugin-jsx-a11y`.
@leiit leiit force-pushed the feat/eslint-9-support branch from 66d24d1 to 8797544 Compare July 10, 2024 21:47
@@ -39,205 +41,219 @@ module.exports = {
scope: makeRule('scope'),
'tabindex-no-positive': makeRule('tabindex-no-positive'),
},
configs: {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is unchanged, just moved to the top level as its reused for the flat configs. Easier to check the diff having "hide whitespace" toggled.

@brendanmorrell brendanmorrell merged commit ea2db16 into brendanmorrell:master Jul 11, 2024
1 check passed
@brendanmorrell
Copy link
Owner

beautiful! merged and will be publishing shortly

@brendanmorrell
Copy link
Owner

fixed in version 2.1.35

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.

Support for Eslint v9
2 participants