eslint-plugin-no-unsanitized
eslint-plugin-no-unsanitized copied to clipboard
eslint v9 support
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
typescript-eslint published today their timeline for it: https://typescript-eslint.io/blog/announcing-typescript-eslint-v8-beta/
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',
},
},
];
typescipt-eslint v8 has been published.
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;
}, {}),
};
}
@mozfreddyb is there any chance to get a release supporting ESLint v9 ?
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.
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.
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 :))