Skip to content

Commit

Permalink
Add documentation about linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Theodor Vararu committed Aug 9, 2016
1 parent 5012bf2 commit 06a75d8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Read the [project principles](docs/principles.md).

If you publish your prototypes online, they **must** be protected by a [username and password](docs/guides/publishing-on-heroku.md). This is to prevent members of the public finding prototypes and thinking they are real services.

You must protect user privacy at all times, even when using prototypes. Prototypes made with the kit look like GOV.UK, but do not have the same security provisions. Always make sure you are handling user data appropriately.
You must protect user privacy at all times, even when using prototypes. Prototypes made with the kit look like GOV.UK, but do not have the same security provisions. Always make sure you are handling user data appropriately.

## Installation instructions

Expand All @@ -35,6 +35,7 @@ You must protect user privacy at all times, even when using prototypes. Prototyp
- [Updating the kit to the latest version](docs/updating-the-kit.md)
- [Tips and tricks](docs/tips-and-tricks.md)
- [Creating routes (server-side programming)](docs/creating-routes.md)
- [Linting](docs/linting.md)

## Community

Expand Down
21 changes: 21 additions & 0 deletions docs/linting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Linting

The prototype kit uses [standardjs](http://standardjs.com/), an opinionated JavaScript linter. All JavaScript files follow its conventions, and it runs on CI to ensure that new pull requests are in line with them.

## Running standard manually

To check the whole codebase, run:

```bash
npm run lint
```

## Running standard in your editor

Easier than running standard manually is to install it as a plugin in your editor. There are [guides for most of the popular editors](http://standardjs.com/index.html#text-editor-plugins). This way, it will run automatically while you work, catching errors as they happen on a per-file basis.

## Do I need to respect this?

If you want to submit a pull request to the prototype kit, your code will need to pass the linter.

If you're just using the prototype kit in a separate project, then no, you aren't forced to use standard, or any other linter for that matter. Just create new files as you would normally.

0 comments on commit 06a75d8

Please sign in to comment.