Throw error if loadConfig cannot find file by path #1007
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.
If given a path to a file that doesn't exist, sass-lint should throw an
error to let the user know it cannot find the config file. Otherwise the
user will have no idea that the default config is being used and theirs
is being ignored.
When not given a config path, continue as usual: return an empty config.
This also fixes relative path issues in the failures test suite.
What do the changes you have made achieve?
They let the user know if the given path to a config file does not exist instead of silently returning an empty config.
Are there any new warning messages?
Yes: 1 new
Error
thrown.Have you written tests?
Yes, and fixed the config file paths in
tests/failures.js
.Have you included relevant documentation
No: I think the error thrown should be the natural result of giving an incorrect filepath, rather than a "new feature".
Which issues does this resolve?
Fixes #1006
<DCO 1.1 Signed-off-by: Henry Blyth <[email protected]>