mozilla / eslint-plugin-no-unsanitized

Custom ESLint rule to disallows unsafe innerHTML, outerHTML, insertAdjacentHTML and alike
Mozilla Public License 2.0
231 stars 38 forks source link

Support for ESLint / Flat config #234

Closed brettz9 closed 6 months ago

brettz9 commented 10 months ago

Hi,

As of ESLint 8, there is now a new format for ESLint config files which requires that plugins follow a specific format. In ESLint 9, this format will be the only one available by default (and other API changes have occurred in ESLint 9 that may affect this plugin).

Please consider adding support so the plugin can continue to work (and without kludges) in ESLint 9.

Info:

  1. https://eslint.org/docs/latest/use/configure/configuration-files-new
  2. https://eslint.org/blog/2022/08/new-config-system-part-1/
  3. https://eslint.org/blog/2022/08/new-config-system-part-2/
  4. https://eslint.org/docs/latest/use/configure/migration-guide

Thanks!

mozfreddyb commented 10 months ago

Thank you for flagging this. That seems important indeed. And with blog posts from 2022, wow. It will take some time until I am available to work through these links and figure out a rough plan. I will try to break it down into smaller chunks and hope to get some sub-issues filed that people may be able to help this.

If anyone is experienced and very eager to help, I won't say no. But I'm happy to do the planning work before to make that easier.

brettz9 commented 10 months ago

The actual changes needed will probably end up being small and easy.

The biggest challenge one might run into I think is if one ends up wanting to offer TypeScript declaration files in the process (and this doesn't necessitate switching the source to TypeScript--just providing the declaration files). The reason one may wish to do that in this context of migrating is that now that ESLint is no longer opaquely loading plugins, leaving this to the user, a TypeScript user will see complaints about missing types for the imported package. But this is of course really a separate question and not strictly necessary for a migration.

ximex commented 5 months ago

when could we expect a new release with v9 support?

mozfreddyb commented 5 months ago

Answered elsewhere. https://github.com/mozilla/eslint-plugin-no-unsanitized/pull/239#issuecomment-2132867450