Skip to content

Commit

Permalink
🚨 Add lint command
Browse files Browse the repository at this point in the history
  • Loading branch information
marcofugaro committed Jun 8, 2018
1 parent 9cd8587 commit 8b82128
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions MIGRATION-GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,8 @@ now becomes
- GENERATE_SOURCEMAP=true yarn build
```
This is more explicit.
- add the lint script to scripts section in the package.json:
```json
"lint": "accurapp-scripts lint",
```
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ Otherwise if you're using netlify:
These are the available commands once you created a project:
- `yarn start` starts a server locally, accessible both from your browser and from another machine using your same wi-fi
- `yarn build` builds the project for production, ready to be deployed from the `build/` folder
- `yarn lint` lints with eslint the `src/` folder. You can pass any [eslint options](https://eslint.org/docs/user-guide/command-line-interface#options) to the lint command, for example if you want to use eslint's fix option, you do it like this:
```json
"lint-fix": "accurapp-scripts lint --fix",
```

**NOTE**: you need to have at least Node v6.x and yarn v1.2.1, make sure you have the correct versions if you run into some problems running these commands. You can check their version by running `node -v` and `yarn -v`.

Expand Down
6 changes: 6 additions & 0 deletions packages/accurapp-scripts/scripts/lint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const cp = require('child_process')

const args = process.argv.slice(2)
const eslint = require.resolve('eslint/bin/eslint')

cp.execSync(`${eslint} --cache ${args.join(' ')} src/`, { stdio: 'inherit' })
1 change: 1 addition & 0 deletions packages/create-accurapp/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ const packageJson = {
scripts: {
start: 'accurapp-scripts start',
build: 'accurapp-scripts build',
lint: 'accurapp-scripts lint',
},
browserslist: {
production: [ '>0.25%', 'not ie 11', 'not op_mini all' ],
Expand Down

0 comments on commit 8b82128

Please sign in to comment.