-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add module as a type of <script> #95
Conversation
I signed in the CLA. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it intentional that BetterHtml
includes a set of acceptable values that is less strict than those declared by shopify/erb_lint? Is it intentional that they share overlapping responsibilities?
Is there an opportunity to replace one with the other?
If not, should ERBLint::Linters::AllowedScriptType be updated to include "module"
as well?
I think it's a good point, but I'm not sure the relationship between erb-lint and better-html. Actually, I'm using erb-lint with linters:
AllowedScriptType:
enabled: true
allowed_types:
- 'application/json'
- 'module'
DeprecatedClasses:
enabled: true
ErbSafety:
enabled: true |
better-html is a HTML parser that can be also used to transform unsafe HTML to safe HTML. We use it as a security measurement. It isn't linter. It just happen to be used the erb-lint as the parser for HTML and ERB. The configuration of the linter should be independent from the list of allowed types in better-html. Their defaults can be the same though. |
Can you please rebase the PR so I can start the CI? |
Thank you. I rebased it. |
Recently, JavaScript module would be getting used because almost all browsers support it, so `module` could also be added in `VALID_JAVASCRIPT_TAG_TYPES` as a `type` of `<script>`.
I also rebased again. |
Merged in de1fe4d |
Recently, JavaScript module would be getting used because almost all browsers support it, so
module
could also be added inVALID_JAVASCRIPT_TAG_TYPES
as atype
of<script>
.What do you think?