Next.js
nextjs.org › docs › app › api-reference › config › eslint
Configuration: ESLint | Next.js
2 weeks ago - eslint-config-next/typescript: Adds TypeScript-specific linting rules from typescript-eslint.
DEV Community
dev.to › jordanahaines › just-use-this-nextjs-eslint-configuration-540
Just use this Next.js Eslint Configuration - DEV Community
January 12, 2025 - If you're just here to find a good, working ESLint configuration for a NextJS project, then look no further. Copy what's below. Although, it's probably out of date, so you can find a version that's been updated since I published this post in my open source project Historio ➡️ in Github here ⬅️. ... npm i --save eslint typescript-eslint eslint-config-next eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-tailwindcss eslint-plugin-unicorn
Videos
08:29
How to setup ESLint and Prettier in Next.js Projects - YouTube
05:40
#2 - Improving DX w/ Prettier & ESLint | Next.JS 14 Series - YouTube
07:41
React/Next.js typescript airbnb eslint code style setup guide - ...
10:30
The SECRET to Perfect Code Formatting with ESLint and Prettier ...
05:51
🚀 Setup Eslint with Nextjs 13 Like a Pro! | Eslint Next.js 13 ...
Medium
medium.com › @wahvanessa22 › im-setting-up-eslint-for-my-next-js-a6f22ebf768b
I'm setting up ESLint for my Next.js + TypeScript project to keep my code clean, consistent, and bug-free. A step you should consider when writing like a pro! | by Wah Vanessa | Medium
May 13, 2025 - I decided to document my findings because of how hard it was, but it was fun to set up ESLint for my next project through its documentation and understanding what is going on, especially with the new changes. For those who do not know what ESLint is, I've got you. If you have ever used a configured linters file, and how it works, you will understand better will I mean by ESLint is an advanced linting configuration that helps you to write cleaner and clearer code.
npm
npmjs.com › package › eslint-config-next
eslint-config-next - npm
ESLint configuration used by Next.js.. Latest version: 16.1.6, last published: a month ago. Start using eslint-config-next in your project by running `npm i eslint-config-next`. There are 1677 other projects in the npm registry using eslint-config-next.
» npm install eslint-config-next
Stack Overflow
stackoverflow.com › questions › 76949413 › configuration-typescript-eslint-in-next-js-13
Configuration typescript-eslint in Next.js 13 - Stack Overflow
Is this the right configuration? ... In '@typescript-eslint', getter functions must always return valid values. /** 1. error: no return */ const p = { get name() { // no returns. }, }; /** 2. warn: return undefined */ const p = { get name() { return }, }; /** 3. success */ const p = { get name() { return 'something' }, }; If there is no return, modify the eslint:recommended rule. Rules Page · { "extends": [ "next/core-web-vitals", "eslint:recommended", "plugin:@typescript-eslint/recommended" ], "parser": "@typescript-eslint/parser", "plugins": ["@typescript-eslint"], "root": true, **"rules": { "getter-return": ["error", { "allowImplicit": true }] }** }
GitHub
github.com › vercel › next.js › discussions › 49337
How to use new "flat config" approach in Eslint? · vercel/next.js · Discussion #49337
I have created a package eslint-config-next-flat (Source code) that is (roughly) a port of the eslint-config-next for FlatConfig. It seems to work perfect for TypeScript projects (not sure about native JavaScript since it requires Babel parser and I don't have a complicated vanilla JS Next.js project to try it out with).
Author vercel
Paulintrognon
paulintrognon.fr › blog › typescript-prettier-eslint-next-js
Start a clean Next.js project with TypeScript, ESLint and Prettier
The package eslint-config-prettier that we use here is only to prevent conflicts between prettier and eslint. I strongly recommend you don't only rely on "format on save" VSCode features, but you also add another layer of safety by running eslint and prettier on each commit. That will make sure that every file you commit has no ESLint error and are correctly formatted. Also, you can run additional checks on commit, like TypeScript type-checking.
GitHub
github.com › Goldziher › eslint-config-next
GitHub - Goldziher/eslint-config-next: This is a strict NextJS/Typescript eslint configuration
This is an extensive ESLint configurations for NextJS based projects. Its compatible with ESLint >=9. npm install --save-dev eslint typescript-eslint @trumpet/eslint-config-next
Author Goldziher
Top answer 1 of 4
7
Try this
import pluginNext from '@next/eslint-plugin-next'
export default defineConfig([
{
plugins: {
'@next/next': pluginNext
},
},
{
files: ['**/*.ts', '**/*.tsx'],
rules: {
...pluginNext.configs.recommended.rules
}
}
])
2 of 4
5
This works for me (I tested with next 15.0.3 / eslint 9.14 / eslint-config-next 15.0.3)
eslint.config.mjs
import pluginNext from '@next/eslint-plugin-next';
import parser from '@typescript-eslint/parser'; // optional
export default [
{
name: 'ESLint Config - nextjs',
languageOptions: {
parser, // optional
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
},
plugins: {
'@next/next': pluginNext,
},
files: ['**/*.{js,mjs,cjs,ts,jsx,tsx}'],
rules: {
...pluginNext.configs.recommended.rules,
...pluginNext.configs['core-web-vitals'].rules,
},
},
];
ESLint
eslint.org › docs › latest › use › configure › configuration-files
Configuration Files - ESLint - Pluggable JavaScript Linter
In this case, ESLint does not search for configuration files and instead uses some-other-file.js. For Deno and Bun, TypeScript configuration files are natively supported; for Node.js, you must install the optional dev dependency jiti in version 2.2.0 or later in your project (this dependency is not automatically installed by ESLint):
TypeScript ESlint
typescript-eslint.io › getting-started
Getting Started | typescript-eslint
This page is a quick-start for ESLint's new "flat" config format to go from zero to linting with our recommended rules on your TypeScript code as quickly as possible. ... For the same guide but for ESLint's legacy format — see Legacy ESLint Setup. For quickstart information on linting with type information — see Typed Linting. First, install the required packages for ESLint, TypeScript, and our tooling: ... Next...
Gitlab
soykje.gitlab.io › en › blog › nextjs-typescript-eslint
Next.js & Typescript + ESLint
When you visit any website, it may store or retrieve information on your browser, mostly in the form of cookies. This information might be about you, your preferences or your device and is mostly used to make the site work as you expect it to. The information does not usually directly identify ...
Reddit
reddit.com › r/reactjs › what eslint plugins do you recommend when using nextjs?
r/reactjs on Reddit: What ESLint Plugins Do You Recommend When Using NextJs?
February 20, 2024 -
I've recently been looking at the Bullet Proof React repository and noticed that they use a few ESLint plugins. I've only ever used what comes with Next. What plugins do you use and recommend?
Top answer 1 of 6
15
eslint-plugin-react eslint-plugin-react-hooks eslint-config-next typescript-eslint/eslint-plugin eslint-plugin-prettier sort-imports or eslint-plugin-simple-import-sort eslint-plugin-boundaries And plugins for tests (RTL, Cypress etc.) if you want to enforce lint on your tests and you're using these libs.
2 of 6
9
Here is my ESLint plugins I use for all my NextJS projects: https://github.com/ixartz/Next-js-Boilerplate/blob/main/package.json#L85-L102 There are 18 plugins. I also use ESLint plugins for testing part: Jest, Playwright, Storybook, etc. And here you can find how I configure everything: https://github.com/ixartz/Next-js-Boilerplate/blob/main/.eslintrc
Chris
chris.lu › web_development › tutorials › next-js-static-first-mdx-starterkit › typescript-eslint-flat-config
Typescript Linting and custom flat config - Next.js 15 Tutorial
There is one major difference between classic configs and flat config setups for typescript-eslint, for an ESLint v8 setup you would usually install two packages, @typescript-eslint/eslint-plugin the package to the tseslint plugin and also the @typescript-eslint/parser parser package, but since ESLint 9 most tutorials (that I saw) had switched to using a single typescript-eslint package that contains the plugin, the parser as well as configurations · We start by installing typescript-eslint package using the following command: npm i typescript-eslint@latest --save-dev --save-exact · Next we will fine tune our typescript linting by adding a custom/typescript-eslint/recommended config: