Commit graph

4 commits

Author SHA1 Message Date
Fabien Basmaison 52d2f0e331 [assets] Document functions and variables:
- Use expressive names for variables.
- Add docblocks for each function.
- Add ESLint rules for comments.
2021-04-06 16:17:20 +02:00
Fabien Basmaison 70c652d565 [assets] Add rules to ESLint:
- Fix long line.
- Enforce a few stylistic habits:

    - Avoid some potential dangerous constructs.
    - `arrow-spacing`: Use at least one space around arrows.
    - `keyword-spacing`: Use at least one space around keywords (if, else, for…).
    - `no-multiple-empty-lines`: Only use one empty line between code.
	- `no-var`: Use `let` or `const` instead of `var`:
    - `padded-blocks`: Do not pad blocks.
    - `padding-line-between-statements`: Use empty lines between some statements.
    - `space-before-blocks`: Use at least one space before the opening brace of a block.
2021-04-06 10:42:52 +02:00
Fabien Basmaison 27e47b0a35 [lint] Update context for linting frontend files:
- Lint files when pushing on the _frontend_ branch.
- Lint files when eslint or stylelint config files are updated.
- Use _strict_ parsing of JS files by default. This should make the JS linting test to fail.
2021-04-05 16:35:09 +02:00
Fabien Basmaison 53f03457cc Add linter for JS files with basic recommended rules:
- Add Github Action.
- Fix JS files to match rules; mostly `globals` and `exported`.
2021-03-31 17:07:28 +02:00