Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: New rule to disallow certain attribute values #145

Merged
merged 5 commits into from
Oct 13, 2023

Conversation

Adam-Gillespie345
Copy link
Contributor

@Adam-Gillespie345 Adam-Gillespie345 commented Oct 12, 2023

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.

Copy link
Owner

@yeonjuan yeonjuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Adam-Gillespie345 Thanks for your contribution! I left some reviews.

docs/rules/no-restricted-attr-values.md Outdated Show resolved Hide resolved
@@ -21,7 +21,7 @@
"license": "MIT",
"devDependencies": {
"cspell": "^6.19.2",
"eslint": "^7.14.0",
"eslint": "^7.32.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to update esLint to handle the optional chaining

@codecov
Copy link

codecov bot commented Oct 13, 2023

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%) ⬇️

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%> (ø)

Copy link
Owner

@yeonjuan yeonjuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you very much for your contribution! @Adam-Gillespie345
This change will be included in the next release. I'll do some testing and release a new version in the next week!

@yeonjuan yeonjuan merged commit e129918 into yeonjuan:main Oct 13, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants