ooow / jewel-f

Jewel Front End
1 stars 0 forks source link

Prettier updates all the files in git hooks pre-commit #58

Closed nikitabelonogov closed 5 years ago

nikitabelonogov commented 5 years ago

I faced the issue

Steps to reproduce:

}

- trigger pre-commit hook
 ```sell
git add .
git commit -m 'hook test'
nikitabelonogov commented 5 years ago

lint-staged execute command for each changed file separately e.g.: npm run prettier:fix <file_name>

BUT there is a filter difined in the prettier:fix step. The final command is the following: prettier --config .prettierrc.yaml --write 'src/**/*.{js,jsx,scss} <file_name>' And prettier goes crazy here 🤪. It executes for filter files not only for <file_name>.

I suggest to go with this solution w/ filter.

ooow commented 5 years ago

@ooow I'll check this case today.