yeonjuan / html-eslint

ESLint plugin for linting HTML
https://html-eslint.org
MIT License
161 stars 28 forks source link

Include rule to validate attribute values #144

Closed Adam-Gillespie345 closed 1 year ago

Adam-Gillespie345 commented 1 year ago

Currently I have been unable to use the existing rules in to validate the values of attributes within html files with ESLint. The reason this is important is in a current project code base there are only a few html files and if someone were to update Class or Classname attributes to certain values it may unmask sensitive data for third party services like sentry that montior my website.

I have created a rule, docs and tests for a solution that essentially extends the no-restricted-attrs rule but do not have permissions to create a PR. I would love to show you the code and see if it is up to standard and will be happy to make any necessary changes to get it up to scratch. I have tested this as a patch as well and works well.

Brian-Gaffney commented 1 year ago

I'm also interested in this, would like to be able to ban certain classes and HTML attribs.

yeonjuan commented 1 year ago

Hi @Adam-Gillespie345 Thanks for the suggestion!

I have created a rule, docs and tests for a solution that essentially extends the no-restricted-attrs rule but do not have permissions to create a PR.

I'm wondering why you can't create a PR. Have you tried Creating a pull request from a fork ?

I would love to show you the code and see if it is up to standard and will be happy to make any necessary changes to get it up to scratch. I have tested this as a patch as well and works well.

Of course! , sharing your code would be great to improve this project! How will you share your code?

Adam-Gillespie345 commented 1 year ago

Have created a PR: https://github.com/yeonjuan/html-eslint/pull/145

yeonjuan commented 1 year ago

@Adam-Gillespie345 It's released in v0.20.0. Thanks!!