3

I am using precommit hook and husky in my project where I want to check the eslint and stylelint and prettify the code. I do not want to do any test in my application so there wont be any test related work. However, I am getting the following issue whenever i commit the changes.

enter image description here

This is how i have configured

"scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject",
    "lint:css": "stylelint src/**/*.js",
    "flow": "flow",
    "precommit": "lint-staged"
  },
  "husky": {
    "hooks": {
      "pre-commit": "yarn precommit"
    }
  },

lint-staged.config.js

module.exports = {
  linters: {
    '**/*.+(js|css|graphql)': [
      'eslint --fix',
      'prettier --write',
      'stylelint app/**/*.js',
      'git add',
    ],
  },
}

I am using create-react-app. How do i bypass the test check when commiting the changes?

milan
  • 2,409
  • 2
  • 34
  • 71

0 Answers0