Select Git revision
style_guide_js.md
Forked from
GitLab.org / GitLab FOSS
1232 commits behind the upstream repository.
-
Filipa Lacerda authoredFilipa Lacerda authored
style_guide_js.md 9.81 KiB
Style guides and linting
See the relevant style guides for our guidelines and for information on linting:
JavaScript
We defer to Airbnb on most style-related conventions and enforce them with eslint.
See our current .eslintrc for specific rules and patterns.
Common
ESlint
-
Never disable eslint rules unless you have a good reason.
You may see a lot of legacy files with/* eslint-disable some-rule, some-other-rule */
at the top, but legacy files are a special case. Any time you develop a new feature or refactor an existing one, you should abide by the eslint rules. -
Never Ever EVER disable eslint globally for a file
// bad
/* eslint-disable */
// better
/* eslint-disable some-rule, some-other-rule */
// best
// nothing :)
- If you do need to disable a rule for a single violation, try to do it as locally as possible