Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Install node based JS and SCSS linters
This is added to this project as part of roll-out across GOV.UK of stylelint to replace scss_lint-govuk as the default linter. As this project has very little JS and Sass I did um and ah about whether to add this but it felt best to be consistent. This project previously didn't have any JS linting installed so Standard is installed as per the GDS Way [1]. For SCSS linting stylelint-config-gds [2] is used which is a GDS standard based upon stylelint [3]. Both of these projects are then added to dependabot to have their versions maintained with the same approach we use for rubocop-govuk. Standardx is used instead of standard because Standard 16 introduced a rule that disallowed the use of `var`, instead preferring `let` or `const` [4]. This conflicts with the GOV.UK approach where we tend to not embrace features that we know will break old browsers even if they're not necessarily supported [5], disallowing var will mean that < IE 11 will be unable to run any of the JS. In order to customise standard rules this project has switched to using standardx [6] which allows us to disallow rules. I've used this so we can disallow the 'no-var' rule. [1]: https://gds-way.cloudapps.digital/manuals/programming-languages/js.html#linting [2]: https://github.com/alphagov/stylelint-config-gds [3]: https://stylelint.io/ [4]: standard/standard#633 [5]: alphagov/govuk_publishing_components#1611 (comment) [6]: https://github.com/standard/standardx
- Loading branch information