mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
chore: add command to run eslint with --fix
flag (#5829)
This commit is contained in:
parent
49ce65943c
commit
510354054f
@ -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!
|
||||
|
||||
|
@ -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/",
|
||||
|
Loading…
Reference in New Issue
Block a user