Skip to content

Commit

Permalink
Merge pull request #5 from sarpik/sarpik/create-react-app-docs-update
Browse files Browse the repository at this point in the history
See:

* #3 
* #4
  • Loading branch information
kiprasmel committed Feb 2, 2020
2 parents af5895c + 7db59f2 commit 3f5c90e
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 4 deletions.
38 changes: 36 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,43 @@ See also [the README of vscode-eslint](https://github.com/microsoft/vscode-eslin

## With Create React App

1. (meh) You gotta eject first - `yarn eject` (`npm run eject`)
1. Run `npx install-peerdeps --dev eslint-config-sarpik --yarn`
1. Crack open your `package.json` and replace `"extends": "react-app"` with `"extends": "sarpik"`
1. Crack open your `package.json` and
1. replace `"extends": "react-app"` with `"extends": "sarpik"`
2. replace `"eslint": "5.x" with `"eslint": "6.x"`
3. update `lint` and `lint:fix` scripts - append the `--ext js,jsx,ts,tsx` option (required for eslint `6.x`, see https://github.com/sarpik/eslint-config-sarpik/issues/4)

Your `package.json` should end up like this:

```json
{
"scripts": {
"lint": " eslint . --ext js,jsx,ts,tsx",
"lint:fix": "eslint . --ext js,jsx,ts,tsx"
},
"eslintConfig": {
"extends": "sarpik"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "<version>",
"@typescript-eslint/parser": "<version>",
"babel-eslint": "<version>",
"eslint": "6.x",
"eslint-config-airbnb": "<version>",
"eslint-config-prettier": "<version>",
"eslint-config-sarpik": "<version>",
"eslint-plugin-flowtype": "<version>",
"eslint-plugin-html": "<version>",
"eslint-plugin-import": "<version>",
"eslint-plugin-jsx-a11y": "<version>",
"eslint-plugin-monorepo": "<version>",
"eslint-plugin-prettier": "<version>",
"eslint-plugin-react": "<version>",
"eslint-plugin-react-hooks": "<version>",
"prettier": "<version>"
}
}
```

## 🤬🤬🤬🤬 IT'S NOT WORKING

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"license": "MIT",
"private": false,
"scripts": {
"lint": " eslint . --ignore-pattern '!.eslintrc.js'",
"lint:fix": "eslint . --ignore-pattern '!.eslintrc.js' --fix",
"lint": " eslint . --ext js,jsx,ts,tsx --ignore-pattern '!.eslintrc.js'",
"lint:fix": "eslint . --ext js,jsx,ts,tsx --ignore-pattern '!.eslintrc.js' --fix",
"prepublishOnly": "yarn lint:fix",
"postpublish": "npx install-peerdeps --global --yarn eslint-config-sarpik@latest"
},
Expand Down

0 comments on commit 3f5c90e

Please sign in to comment.