---
title: "Discussion on \"How To Style Your Next.JS Projects EXACTLY Like Google (in TypeScript)\" | Hashnode"
description: "Discussion on \"How To Style Your Next.JS Projects EXACTLY Like Google (in TypeScript)\". Learn how to utilize TypeScript, ESLint, Prettier, Husky & VS Code to style a Next.JS Project using Google's TypeScript Style Guide."
url: "https://hashnode.com/posts/nextjs-eslint-prettier-husky/60909ac5150acd02607141c6"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How To Style Your Next.JS Projects EXACTLY Like Google (in TypeScript)](https://blog.jarrodwatts.com/nextjs-eslint-prettier-husky?utm_source=hashnode&utm_medium=feed)

Learn how to utilize TypeScript, ESLint, Prettier, Husky & VS Code to style a Next.JS Project using Google's TypeScript Style Guide.

May 4, 2021 · 10 min read · blog.jarrodwatts.com  
Read the article

-   [#nextjs](https://hashnode.com/tag/nextjs)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#typescript](https://hashnode.com/tag/typescript)
-   [#eslint](https://hashnode.com/tag/eslint)
-   [#prettier](https://hashnode.com/tag/prettier)

## Written by

[Jarrod Watts](https://hashnode.com/@JarrodWatts)

@JarrodWatts · Sydney, Australia

  
[View profile](https://hashnode.com/@JarrodWatts)

Developer Relations Engineer @ Polygon Labs

A software engineer turned developer relations engineer in the web3 space, from Australia 🇦🇺.

## Responses 4

Markdown supported · ⌘↵ to post

[Umut Tufanoglu](https://hashnode.com/@utdevelopment)

[Dec 11, 2021](https://hashnode.com/posts/nextjs-eslint-prettier-husky/60909ac5150acd02607141c6/comment/61b4f438b18f1f0c68301350)

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

[Mario](https://hashnode.com/@mariobm)

[May 8, 2021](https://hashnode.com/posts/nextjs-eslint-prettier-husky/60909ac5150acd02607141c6/comment/6096c2491ea29f2c341e0490)

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](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html) to import react just for JSX

[Jarrod Watts](https://hashnode.com/@JarrodWatts)

[May 9, 2021](https://hashnode.com/posts/nextjs-eslint-prettier-husky/60909ac5150acd02607141c6/comment/6096c2491ea29f2c341e0490#reply-60972c9b1ea29f2c341e0942)

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

[Obayuwana Paul](https://hashnode.com/@Pauxiel)

[May 7, 2021](https://hashnode.com/posts/nextjs-eslint-prettier-husky/60909ac5150acd02607141c6/comment/60953ac4f7929f0c6e37c77c)

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

[Jarrod Watts](https://hashnode.com/@JarrodWatts)

[May 8, 2021](https://hashnode.com/posts/nextjs-eslint-prettier-husky/60909ac5150acd02607141c6/comment/60953ac4f7929f0c6e37c77c#reply-60968d4b1ea29f2c341e0108)

Really glad to hear that! Thank you!

[Pankaj Patel](https://hashnode.com/@pankajpatel)

[May 7, 2021](https://hashnode.com/posts/nextjs-eslint-prettier-husky/60909ac5150acd02607141c6/comment/6094f396d1bbc47b91a67fc9)

Great article Jarrod, the pre-commit script looks really good.

Though I would also suggest to checkout [lint-staged](https://www.npmjs.com/package/lint-staged/) package.

Husky+LintStaged will allow you to configure commit hooks right from package.json

Keep up the good writing.

[Jarrod Watts](https://hashnode.com/@JarrodWatts)

[May 7, 2021](https://hashnode.com/posts/nextjs-eslint-prettier-husky/60909ac5150acd02607141c6/comment/6094f396d1bbc47b91a67fc9#reply-60950c70a7a3827bb64cf412)

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!
