-
Notifications
You must be signed in to change notification settings - Fork 421
Description
The Code Guide wiki page has various recommendations for HTML, CSS, and JavaScript source code style.
We also have various linters, runnable with npm run lint.
We should make sure that the Code Guide reflects the code style that we want, and remove everything that is not important or not easily lintable, and then make sure that the linters check for everything that the code guide requires (where possible). We can implement new lint rules in upstream projects (like in #2069).
If we require things that are not lintable, clarify which rules require manual review.
In the last TF meeting we briefly discussed changing the CSS prefixed properties formatting rule: either remove the rule, or change to disallow prefixed properties.
Other possible changes:
- HTML
- Practicality over purity: This rule seems vague and hard to review against, and impossible to lint. Suggest removing.
- boolean attributes: the rule is fine, but it can be one sentence.
- reducing markup: this seems hard to review for and impossible to lint. Suggest removing.
- CSS
- syntax may need some updates to match current
Stylelint(Infrastructure: Update Stylelint #2077 (comment)). - declaration order: is this rule helpful or is it mostly make-work for contributors and reviewers? Is it readily lintable?
- shorthand notation: I don't understand the benefit of this rule, and it seems impossible to lint for. Suggest removing.
- code comments is a bit vague, and not lintable. Either remove or clarify.
- class names has 6 bullet points, only the first one is lintable. Can we simplify? Also remove reference to Sass/Less.
- syntax may need some updates to match current
- JS
- Is the reference to AirBnB JavaScript Style Guide what we should use? Are the linters following it?