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

eslint v9 support #241

Closed
mozfreddyb opened this issue May 28, 2024 · 8 comments
Closed

eslint v9 support #241

mozfreddyb opened this issue May 28, 2024 · 8 comments
Assignees

Comments

@mozfreddyb
Copy link
Collaborator

Since this seems like a common question.

I started working on it, but it looks like there's a conflict with our dependencies: I think we'll need to wait until typescript-eslint releases a version that supports eslint 9.

This is unless someone can help me figure out a way to support eslint >=9 with optional typescript and eslint <9 with full typescript support

@nicolo-ribaudo
Copy link

typescript-eslint published today their timeline for it: https://typescript-eslint.io/blog/announcing-typescript-eslint-v8-beta/

@alecmev
Copy link
Contributor

alecmev commented Jul 18, 2024

In the meanwhile, this works:

import { fixupPluginRules } from '@eslint/compat';
import plugin from 'eslint-plugin-no-unsanitized';

const NO_UNSANITIZED_CONFIG = [
  {
    files: [/* ... */],
    plugins: { 'no-unsanitized': fixupPluginRules(plugin) },
    rules: {
      'no-unsanitized/method': 'error',
      'no-unsanitized/property': 'error',
    },
  },
];

@Sparticuz
Copy link

typescipt-eslint v8 has been published.

@lukpsaxo
Copy link

lukpsaxo commented Aug 2, 2024

You also need this, it seems eslint compat doesn't do it:

function setSchemaFalse(plugin) {
    return {
        rules: Object.keys(plugin.rules).reduce((acc, rule) => {
            acc[rule] = {
                create: plugin.rules[rule].create,
                meta: {
                    ...plugin.rules[rule].meta,
                    schema: plugin.rules[rule].meta.schema ?? false,
                },
            };
            return acc;
        }, {}),
    };
}

@stof
Copy link
Contributor

stof commented Aug 26, 2024

@mozfreddyb is there any chance to get a release supporting ESLint v9 ?

@mozfreddyb
Copy link
Collaborator Author

mozfreddyb commented Aug 29, 2024

My apologize for the silence. I had been on vacation for a longer while and github backlog was just not my main priority. I will get a release out as soon as possible. I have a PR in #247 but it will take a while before I can allocate the time for this.

@mozfreddyb
Copy link
Collaborator Author

Looks like I did find the time for it. #247 is waiting for review and I plan to release on Monday if everything goes well.

@mozfreddyb
Copy link
Collaborator Author

version 4.10 is now available.

Thank you all for your patience (and major kudos to @Standard8 for doing most of the work here :))

@mozfreddyb mozfreddyb unpinned this issue Sep 2, 2024
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

6 participants