Problem/Motivation
We should enforce some coding standards.
Proposed resolution
Should also be able to follow open-wc here - look at @open-wc/eslint-config, @open-wc/prettier-config
Also make sure we're formatting markdown as well.
Remaining tasks
* Install and configure Eslint
* Install and configure prettier
* Add related npm scripts.
* Document process to configure VSCode to format on save.
* Enforce with Husky
Issue fork gdwc-3203869
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
brianperryComment #3
brianperryComment #6
brianperryStill having problems with issue forks, but merged this manually.
Content added to the docs provides a good summary of the changes:
## Linting
Staged files will be linted and formatted prior to commit using lint-staged and
husky. It is also possible to run these tasks manually using the following
commands:
npm run lint
npm run format
VSCode users can also format code on save using the
[Eslint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
and
[Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)
extensions. These extensions will be suggested when loading the project if they
have not already been installed. An example settings file is included in
`.vscode/example.settings.json`. Save this file as `.vscode/settings.json` or
incorporate the contents into your existing settings.json file to enable format
on save in your project.
Comment #7
brianperryComment #8
brianperry