Unverified Commit f0f64465 authored by Robert Knight's avatar Robert Knight Committed by GitHub

Merge pull request #936 from hypothesis/eslint-prettier-docs

Update Code Style docs to mention ESLint and Prettier
parents a1c2b014 fbec5307
...@@ -144,18 +144,20 @@ Code Style ...@@ -144,18 +144,20 @@ Code Style
JavaScript JavaScript
########## ##########
Hypothesis uses ESLint to help maintain style consistency. You can check your Hypothesis uses ESLint_ (a linter) and Prettier_ (an automated code formatter)
changes for conformance using: to ensure style consistency and help prevent common mistakes. Plugins are
available for most editors for these tools. We recommend that you set these up
before making changes to the code.
To auto-format code and run lint checks locally using the CLI, run:
.. code-block:: sh .. code-block:: sh
make format
make lint make lint
Many lint errors can be fixed automatically using: .. _ESLint: https://eslint.org
.. _Prettier: https://prettier.io
.. code-block:: sh
./node_modules/.bin/eslint --fix
CSS CSS
### ###
......
...@@ -147,7 +147,7 @@ ...@@ -147,7 +147,7 @@
"deps": "check-dependencies", "deps": "check-dependencies",
"lint": "eslint .", "lint": "eslint .",
"checkformatting": "prettier --check 'src/**/*.js'", "checkformatting": "prettier --check 'src/**/*.js'",
"format": "prettier --write 'src/**/*.js'", "format": "prettier --list-different --write 'src/**/*.js'",
"test": "gulp test", "test": "gulp test",
"report-coverage": "codecov -f coverage/coverage-final.json", "report-coverage": "codecov -f coverage/coverage-final.json",
"version": "make clean build/manifest.json", "version": "make clean build/manifest.json",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment