Closed rohit-ambre closed 4 years ago
Hi, I have project with react and express but it is not wrapped using lerna. project structure:
project ├── client/ │ ├── src/ │ ├── package.json │ ├── index.js │ └── utils.js ├── cli.js ├── src/ ├── index.js ├── config.js └── package.json
So outside folder contains all express related files and client folder has create-react-react(typescript) project. I have separate eslint config for both. express eslint is in root and react's eslint is in client folder.
my scripts in base package.json:
package.json
"lint": "eslint .", "lint:fix": "eslint . --fix", "client:lint": "cd client && npm run lint", "client:lint:fix": "cd client && npm run lint:fix",
my husky and lint-staged config:
"lint-staged": { "./**/*": [ "npm run lint:fix" ], "./client/**/*.{js,jsx,ts,tsx}": [ "npm run client:lint:fix" ] }, "husky": { "hooks": { "pre-commit": "lint-staged" } },
what I need is,
client
so in my configuration, it is working fine for express files but sometimes it is failing in client related files. it says,
Prevented an empty git commit!
Because even if my react files have changes and linting errors it is not committing those files after running the lint fixes.
Can anyone please help me with the correct lint-staged config
lint-staged
while committing to this branch it is giving errors in .eslintignore etc file which are ignored like following, so I pushed it with --no-verify flag
.eslintignore
--no-verify
Thank you
Please create an issue in the lint-staged repo. I will not be able to help you with this.
Would recommend going through the readme
Hi, I have project with react and express but it is not wrapped using lerna. project structure:
So outside folder contains all express related files and client folder has create-react-react(typescript) project. I have separate eslint config for both. express eslint is in root and react's eslint is in client folder.
my scripts in base
package.json
:my husky and lint-staged config:
what I need is,
client
folder then it should use client lint command to fixso in my configuration, it is working fine for express files but sometimes it is failing in client related files. it says,
Because even if my react files have changes and linting errors it is not committing those files after running the lint fixes.
Can anyone please help me with the correct
lint-staged
configwhile committing to this branch it is giving errors in![Screenshot 2020-07-20 at 10 16 56 PM](https://user-images.githubusercontent.com/20537740/87964115-5a4d0d80-cad7-11ea-87f8-4a92b55f3360.png)
.eslintignore
etc file which are ignored like following, so I pushed it with--no-verify
flagThank you