-
-
Notifications
You must be signed in to change notification settings - Fork 639
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 support for ESLint 9 #978
Comments
Yes, that's right. In eslint 9, RuleTester only supports flat config, so it makes things more complicated. I think we need flat config support before we have eslint 9 support. |
See #891. |
I'm using the plugin with the flat config. import pluginJsxA11y from 'eslint-plugin-jsx-a11y';
export default [
...
{
plugins: {
'jsx-a11y': pluginJsxA11y,
},
rules: pluginJsxA11y.configs.recommended.rules,
},
...
]; |
This comment was marked as spam.
This comment was marked as spam.
#993 adds support for flat config, so in theory, we're now unblocked from supporting eslint 9. |
@pauliesnug please note that TS's module system is horrifically broken unless you enable synthetic imports and esModuleInterop - you shouldn't see an issue with the default import that way. |
You are getting an import error because declare module "eslint-plugin-jsx-a11y"; Note that you will continue to get type errors everytime you do anything with |
(if you're going to make type defs, please do so in DefinitelyTyped, so others can benefit) |
good idea, i'll do that until they are shipped alongside the plugin |
@ljharb done DefinitelyTyped/DefinitelyTyped#70203. Once the PR is merged, it should now be possible to do the following (and by it should, I mean I am using this): import { fixupConfigRules } from "@eslint/compat";
import jsxA11y from "eslint-plugin-jsx-a11y";
export default [
// Other configs here
...fixupConfigRules(jsxA11y.flatConfigs.recommended),
]; |
@ljharb @pauliesnug If either of you would like to double check the PR and make sure I typed everything correctly, you are welcome to do so. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
You are correct in that sense, but its ultimately a personal preference thing. I guess the main differentiation for me is developer experience, whereas yours is user experience. There is nothing wrong with JSDoc commented pure JS, except that it causes headaches for TS users because TS really doesn't like untyped things. Ultimately, an ideal solution is probably both good JSDoc comments and TS. JSDoc allows JS users to get the advantages of type awareness (not the same as type checking), while TS users get their type safety. Yes, you are correct that there are some TS options that negate some (not all, don't conflate the 2) type safety features. However, that's intended. One of the nice things about TS is that you, as the developer, decide how you consume and compile your code. As for Svelte, another reason for not using TS (especially in very large projects) is TS's compiler is not fast (and anyone who says it is is lying to you). That's not the only reason Svelte is going pure JS though. That move is also part of Svelte's push to embrace standards as they are, and not to meddle with them like other frameworks do. That is once of the things that made Svelte popular, and why it's still so loved. Ultimately, we can agree to disagree. However, there is another alternative to pure TS and pure JS. You could simply pass your pure JS into the TS compiler and it will spit out as This will be my last comment on this issue. I see no point in discussing it further. |
Consumers can’t tell the difference between a TS project, a JS project with JSdoc types, or a typeless project with DT types. The contributor experience for the first two is largely identical as well. |
ESLint 9 is released, but it looks like
eslint-plugin-jsx-a11y
does not yet support it.There are breaking API changes: https://eslint.org/docs/latest/use/migrate-to-9.0.0#breaking-changes-for-plugin-developers
There is also a new default config format ("flat config") that probably also needs some adjustment in the exported
recommended
rules; though, support for flat config could be considered a separate issue.The text was updated successfully, but these errors were encountered: