eslint-plugin-no-unsanitized icon indicating copy to clipboard operation
eslint-plugin-no-unsanitized copied to clipboard

eslint v9 support

Open mozfreddyb opened this issue 1 year ago • 1 comments

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

mozfreddyb avatar May 28 '24 08:05 mozfreddyb

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

nicolo-ribaudo avatar May 28 '24 10:05 nicolo-ribaudo

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',
    },
  },
];

alecmev avatar Jul 18 '24 10:07 alecmev

typescipt-eslint v8 has been published.

Sparticuz avatar Aug 01 '24 13:08 Sparticuz

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;
        }, {}),
    };
}

lukpsaxo avatar Aug 02 '24 07:08 lukpsaxo

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

stof avatar Aug 26 '24 16:08 stof

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 avatar Aug 29 '24 13:08 mozfreddyb

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 avatar Aug 30 '24 10:08 mozfreddyb

version 4.10 is now available.

  • https://github.com/mozilla/eslint-plugin-no-unsanitized/releases/tag/4.1.0
  • https://www.npmjs.com/package/eslint-plugin-no-unsanitized

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

mozfreddyb avatar Sep 02 '24 08:09 mozfreddyb