Sign in
Log inSign up
Jarrod Watts

105 likes

·

28.4K reads

7 comments

Pankaj Patel
Pankaj Patel
May 7, 2021

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.

2
·
·1 reply
Jarrod Watts
Jarrod Watts
Author
·May 7, 2021

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!

·
Obayuwana Paul
Obayuwana Paul
May 7, 2021

Thanks a lot for this article jarrod. It really going to be helpful for me

·
·1 reply
Jarrod Watts
Jarrod Watts
Author
·May 8, 2021

Really glad to hear that! Thank you!

·
Mario
Mario
May 8, 2021

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

·
·1 reply
Jarrod Watts
Jarrod Watts
Author
·May 9, 2021

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 :-)

·
Umut Tufanoglu
Umut Tufanoglu
Dec 11, 2021

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']
  }
}
·