RepoSense
RepoSense copied to clipboard
Implement style check on spacing
- there should be space before curly bracket in scss file, e.g.
.fileTypeLabel{ //missing space
}
- there should be check for spacing before : in pug file, e.g.
'color' : getFontColor // false
'color': getFontColor // true
First one can be fixed by adding "block-opening-brace-space-before": "always"
to stylelintrc
. Second one I think so far there is no official support? Since it is linting style=""
blocks in pug
files I think should be done by stylelint
as well.
Can I work on this?
Firstly, perhaps we should consider adding the first check and partially close this issue, as the check is fairly simple to add.
Secondly, looking further into finding out how we can implement the style check for spaces before a ':' in our pug
files, there is no official support by the pug
linter. Looking at using stylelint
for this check, there is a rule, declaration-colon-space-before: "never"
which would precisely implement the check in question, though in version 15.0.0 of stylelint
, this rule, along with many of our existing rules are deprecated, and slated for removal at the next major release. Furthermore, it sees that the pug
format is not officially supported by stylelint
, thus requiring either further waiting until it is officially supported (seems like there are no plans for this), or a large amount of implementation work for a postcss
custom syntax/parser, a list of which can be found here.
While the rules have been removed from stylelint v15
onwards, they have recently been moved to a community plugin. If we use this plugin, we can update stylelint
to the latest version (barring other breaking changes).
Regarding the pug
issue, given that we no longer have any pug
extension files, perhaps this is not such a pressing issue. This might be worth a look for the pug
templates in the Vue
files.
@sopa301 Feel free to create a new issue if you feel that eslint-plugin-vue-pug might be a good addition to the FE, so the team can discuss it further.