This repository was archived by the owner on Aug 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
No subprocess #112
Merged
Merged
No subprocess #112
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
aa36a3e
Need tiny-promisify for changes
download13 903919b
Linter now directly imports htmlhint instead of running it as a
download13 3989522
Froze the htmlhint dependency version.
download13 f84d299
strip-json-comments is now a dependency
download13 f652f2b
Replaced all imports with targeted require calls
download13 0755fa9
Removed unneeded config export
download13 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This might not be a good idea, since it has extra functionality compared to
htmlhintitself, but what do you think about using something like cosmiconfig?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.
I'm not sure I understand what you mean. Are you concerned about replicating existing htmlhint functionality inside this package? Since htmlhint does not provide an exported
getConfigfunction we're going to need to replicate that functionality in some way.cosmicconfig could fill this role, but I have two concerns about it. First, it's another module to load which will likely add a few milliseconds to the startup time. Second, it looks for other possible versions of config files as well (
.htmlhintrc.yml,.htmlhintrc.js, etc). htmlhint only supports.htmlhintrc. Supporting other forms of the config file might be helpful to someone but strictly speaking it's not how htmlhint behaves and might be confusing to users.As for the current method, file loading and JSON parsing seem pretty tame as far as adding functionality goes. I'd say we should move it out into another module (or at least file) if there was much more of it, but it's only 18 lines and there's an overhead to using
require.If there's some other package that can replicate the behavior of the original
getConfigI'm all for it, but I don't know of one.Thoughts?
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.
I was merely suggesting
cosmiconfigas an option for not dealing with loading and parsing the file. Your second point of concern there is what I meant by "extra functionality compared tohtmlhintitself.I'm perfectly fine with how this is implemented now, so let's just go with that 😉