Used create-react-app template. Windows, OpenServer.

package.json

{
  "name": "league-finder",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "react": "^16.5.2",
    "react-dom": "^16.5.2",
    "react-scripts": "1.1.5"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject",
    "pre-commit": "lint-staged",
    "eslint": "./node_modules/.bin/eslint src/"
  },
  "devDependencies": {
    "eslint-config-prettier": "^3.1.0",
    "eslint-plugin-prettier": "^2.7.0",
    "husky": "^1.0.1",
    "lint-staged": "^7.3.0",
    "prettier": "^1.14.3"
  }
}

.lintstagedrc

{  
  "*.js": ["eslint --fix", "git add"],
}

Result enter image description here

Why "No staged files match *.js"?

New contributor
Senin Yurii is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

Senin Yurii is a new contributor. Be nice, and check out our Code of Conduct.
 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.