Skip to content

Commit

Permalink
chore: add command to run eslint with --fix flag (#5829)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackfranklin committed May 7, 2020
1 parent 49ce659 commit 5103540
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Expand Up @@ -64,8 +64,8 @@ information on using pull requests.

## Code Style

- Coding style is fully defined in [`.eslintrc`](https://github.com/puppeteer/puppeteer/blob/master/.eslintrc.js).
- We are migrating the Puppeteer codebase to TypeScript which is why you'll find both JS and TS files in `src/`.
- Coding style is fully defined in [`.eslintrc`](https://github.com/puppeteer/puppeteer/blob/master/.eslintrc.js) and we automatically format our code with [Prettier](https://prettier.io).
- It's recommended to set-up Prettier into your editor, or you can run `npm run eslint-fix` to automatically format any files.
- If you're working in a JS file, code should be annotated with [closure annotations](https://github.com/google/closure-compiler/wiki/Annotating-JavaScript-for-the-Closure-Compiler).
- If you're working in a TS file, you should explicitly type all variables and return types. You'll get ESLint warnings if you don't so if you're not sure use them as guidelines, and feel free to ask us for help!

Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -24,6 +24,7 @@
"dev-install": "npm run tsc && node install.js",
"install": "node install.js",
"eslint": "([ \"$CI\" = true ] && eslint --ext js --ext ts --quiet -f codeframe . || eslint --ext js --ext ts .)",
"eslint-fix": "eslint --ext js --ext ts --fix .",
"lint": "npm run eslint && npm run tsc && npm run doc",
"doc": "node utils/doclint/cli.js",
"tsc": "tsc --version && tsc -p . && cp src/protocol.d.ts lib/",
Expand Down

0 comments on commit 5103540

Please sign in to comment.