Linter does not take project .scss-lint.yml into account
GrumpyPirate opened this issue · 6 comments
The linter does not appear to take the first local .scss-lint.yml
file found in the project hierarchy, (starting with the linted file) into account, resulting in the config getting ignored and the linter falling back to scss-lint's default config.
It does read the config file when it's located in the sublime project root folder, however this is a bit of a limitation and behaves contrary to what is stated in the README.
For example, the .scss-lint.yml
for a particular project may live inside my-project/src/styles/
. In order to have the linter read this file and apply the custom rules, I'd have to set my-project/src/styles/
to be the sublime project root - whereas in a realistic scenario, I'd want to have my-project
as the project root.
Could the linter be extended to instead use the first found config file?
please use search for the same issue #49
README will be changed to match SublimeLinter 4.
I did actually check #49 - this is a feature request that builds on that, as it was closed.
I'm requesting this to be extended to allow for .scss-lint.yml
files to exist anywhere in the immediate file hierarchy, as opposed to the absolute root of the sublime project.
Would it be possible?
I will keep consistency with SublimeLinter 4 witch sets CWD to project root.
Do you have multiple .scss-lint.yml
files in you project?
You can override config for scss-lint
command in linter config, see README.
I've seen the README, and I'm aware of how to customise the linter config path in individual linters.
I still maintain that it isn't useful, nor practical to require the linter config to sit at the very project root - regardless of whether or not this is an underlying SublimeLinter 4 problem - as this will not be the case for every project. Even for sublime projects that define their linter config inside a package.json (eslint, etc), the package.json will sometimes sit elsewhere, nested in folders further into the directory structure.
Feel free to close the issue as just a required change to the README, but this does kind of render this linter useless for a lot of existing projects.
A workaround in the meantime is to simply throw a blanket linter config into the home directory.
Most of projects contain all configs (.eslintrc .gitignore .rspec .rubocop.yml .slim-lint package.json ...
) in project root, that is why I think SublimeLinter 4 made this change.
You can create .sublime-project
in you project root and set settings for any package there. (https://github.com/SublimeLinter/SublimeLinter/blob/master/docs/settings.rst#project-settings)