yeonjuan / html-eslint

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

feat: New rule to disallow certain attribute values #145

Closed Adam-Gillespie345 closed 1 year ago

Adam-Gillespie345 commented 1 year ago

Here is the code I discussed in the issue earlier, I could have extended the no-restricted-attr rule to also encompass values but felt this might dilute the purpose of the rule so created a new one. This rule will allow users to disable the use certain values on certain attributes which will help in the prevention of security leaks to third party services.

codecov[bot] commented 1 year ago

Codecov Report

Merging #145 (36cbe11) into main (7036619) will decrease coverage by 0.02%. The diff coverage is 97.43%.

@@            Coverage Diff             @@
##             main     #145      +/-   ##
==========================================
- Coverage   97.72%   97.71%   -0.02%     
==========================================
  Files          43       44       +1     
  Lines         879      918      +39     
  Branches      220      230      +10     
==========================================
+ Hits          859      897      +38     
- Misses         17       18       +1     
  Partials        3        3              
Flag Coverage Δ
unittest 97.71% <97.43%> (-0.02%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
packages/eslint-plugin/lib/rules/index.js 100.00% <100.00%> (ø)
...lint-plugin/lib/rules/no-restricted-attr-values.js 97.36% <97.36%> (ø)