105 likes
·
28.4K reads
7 comments
Great article Jarrod, the pre-commit script looks really good.
Though I would also suggest to checkout lint-staged package.
Husky+LintStaged will allow you to configure commit hooks right from package.json
Keep up the good writing.
Thanks for the tip Pankaj! Yeah a little problem with the set up i described is that it checks what you've changed not what you are committing. Great tip!
Thanks a lot for this article jarrod. It really going to be helpful for me
Really glad to hear that! Thank you!
Amazing article, awesome. But just to give my few cents about this:
Not to worry, all that it's saying is that we need two things: React imported if we want to use JSX
As of React v17 you don't need to import react just for JSX
Thanks Mario!
Yeah I am not actually sure why the Google settings enforce that, personally I am not a fan of requiring the comments on each functional component either.
Thanks for the feedback :-)
Hi Jarrod,
Great article, I have a similar kind of setup. One thing which does not work in a nextjs app with eslint / prettier is that custom directories like a hooks or an utils directory do not get formatted. Any idea how to fix that? I googled quite a lot the only thing I found is adding the directories in the next.config.js file, but that only seems to work after building the application.
/** @type {import('next').NextConfig} */
module.exports = {
reactStrictMode: true,
eslint: {
dirs: ['pages', 'components', 'utils', 'lib', 'hooks', 'types']
}
}