Replies: 48 comments 37 replies
-
Legit request, had to implement biome in my turborepo but still had to let next lint run during linting to keep doctoring functions. Would be nice to be able to chose |
Beta Was this translation helpful? Give feedback.
-
This should get more attention. Biome is really becoming a way more performant replacement for the legacy prettier/eslint toolchain. |
Beta Was this translation helpful? Give feedback.
-
Is this a WIP or already supported? |
Beta Was this translation helpful? Give feedback.
-
Easy +1. |
Beta Was this translation helpful? Give feedback.
-
This really needs to happen. Nextjs used to feel like it was the future, now it seems to be in a bit of a mire:
Genuinely starting to ask the question is Nextjs really a good choice now? |
Beta Was this translation helpful? Give feedback.
-
+1 |
Beta Was this translation helpful? Give feedback.
-
+1 |
Beta Was this translation helpful? Give feedback.
-
Would love to see more progress on this. Frustrating to see eslint issues during deployment, when it isn't part of my tool chain. |
Beta Was this translation helpful? Give feedback.
-
+1 |
Beta Was this translation helpful? Give feedback.
-
+1 |
Beta Was this translation helpful? Give feedback.
-
+1 |
Beta Was this translation helpful? Give feedback.
-
+1 |
Beta Was this translation helpful? Give feedback.
-
+1 |
Beta Was this translation helpful? Give feedback.
-
+1 |
Beta Was this translation helpful? Give feedback.
-
+1 |
Beta Was this translation helpful? Give feedback.
-
+1 |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Hi all, You can implement your own linter (biome) just fine. There is nothing in Next.js which is blocking you from using Biome. Follow these steps:
eslint: {
// Warning: This allows production builds to successfully complete even if
// your project has ESLint errors.
ignoreDuringBuilds: true,
}, https://nextjs.org/docs/app/api-reference/next-config-js/eslint
{
"scripts": {
"lint": "biome check ."
}
}
I have seen a lot of people talking about a mismatch of linting in builds in other issues. This is not related to eslint, rather the typescript compiler which runs during {
"scripts": {
"type-check": "tsc --noEmit"
}
} Warning When implementing this yourself you are missing out on the doctoring logic of I still really would love first party biome support! |
Beta Was this translation helpful? Give feedback.
-
Looking forward to this too as I am sick of ESLint breaking changes and wasting a lot of time on something that should be stable enough. Apart from that Biome is way faster then Eslint and Prettier. |
Beta Was this translation helpful? Give feedback.
-
I am not sure what is stopping you. Are you using next lint? Cause that's being terrible from the start. I have my own fmt command that uses biome. You can do it. I guess y want an option on next lint to not do the work hourselves. Right? |
Beta Was this translation helpful? Give feedback.
-
+1 Biome is like a car, while ESLint is a horse. Cars are a recent invention and may not yet be the perfect replacement for horses, but the shift is inevitable. Eventually, we'll have to bid farewell to the old horse. |
Beta Was this translation helpful? Give feedback.
-
Agree, I've switched completely to biome after eslint's v9 f*ckup, I'll never touch eslint again. Biome's DX is awesome. |
Beta Was this translation helpful? Give feedback.
-
I am almost finishing the migration to Biome while keeping All that needs to be done is to patch This is how my patch looks like: diff --git a/index.js b/index.js
index 4c95a88ad4fba7c4257ab5071dbc581d63ee55b4..d5cf85a4aa52dc46d28adbf38ca7b5e44ca6d1d0 100644
--- a/index.js
+++ b/index.js
@@ -31,9 +31,7 @@ sortedPaths.push(...keptPaths)
const hookPropertyMap = new Map(
[
'@typescript-eslint/eslint-plugin',
- 'eslint-plugin-import',
- 'eslint-plugin-react',
- 'eslint-plugin-jsx-a11y',
+ 'eslint-plugin-import'
].map((request) => [
request,
require.resolve(request, { paths: sortedPaths }),
@@ -54,30 +52,9 @@ require('@rushstack/eslint-patch/modern-module-resolution')
module.exports = {
extends: [
- 'plugin:react/recommended',
- 'plugin:react-hooks/recommended',
'plugin:@next/next/recommended',
],
- plugins: ['import', 'react', 'jsx-a11y'],
- rules: {
- 'import/no-anonymous-default-export': 'warn',
- 'react/no-unknown-property': 'off',
- 'react/react-in-jsx-scope': 'off',
- 'react/prop-types': 'off',
- 'jsx-a11y/alt-text': [
- 'warn',
- {
- elements: ['img'],
- img: ['Image'],
- },
- ],
- 'jsx-a11y/aria-props': 'warn',
- 'jsx-a11y/aria-proptypes': 'warn',
- 'jsx-a11y/aria-unsupported-elements': 'warn',
- 'jsx-a11y/role-has-required-aria-props': 'warn',
- 'jsx-a11y/role-supports-aria-props': 'warn',
- 'react/jsx-no-target-blank': 'off',
- },
+ plugins: ['import'],
parser: './parser.js',
parserOptions: {
requireConfigFile: false,
Also you lint script should be updated to:
Output becomes:
Only downside to that is the editor don't show up any ESLint violations, only through command line. Additionally, you can make your team life easier with the following additions to the project (if using vscode). project {
"biome.enabled": true,
"eslint.enable": true,
"sort-imports.on-save": false,
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnPaste": false,
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"quickfix.biome": "always",
"source.organizeImports.biome": "always"
},
"[typescriptreact]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[json]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[css]": {
"editor.defaultFormatter": "biomejs.biome"
}
}
project: {
"recommendations": [
"biomejs.biome"
]
} If you have many projects using ESLint and Prettier and will migrate one at time and is annoyed by the error message that shows up when biome isn't detected, take a look here |
Beta Was this translation helpful? Give feedback.
-
Following so I can throw a big party once we get rid of ESLint. ESLint 8 was painful enough, but 9.x has exceeded all my worst expectations. |
Beta Was this translation helpful? Give feedback.
-
Biome is working hard on version 2.0, with plugin support. Which the NextJS team is perhaps waiting on? |
Beta Was this translation helpful? Give feedback.
-
I think that we might be getting nextjs with biome? Because first the biome 2.0 allows custom plugins, which is a huge step in the right direction, but the biggest one of all is domains for nextjs: https://next.biomejs.dev/linter/domains/#next They're still missing some features from the original eslint plugin: https://nextjs.org/docs/app/api-reference/config/eslint But given that Vercel is sponsoring Biome and that they're using it in a monorepo, could this be a sign that biome will soon be an option for nextjs when biome v2.0 is out of beta? |
Beta Was this translation helpful? Give feedback.
-
Another option, similar to #59347 (comment) is to revert to base eslint config file
and if after applying the required Biome linter changes there are some differences/conflicts that come up during next build, just disable those specific eslint rules:
No patching or any other hackish solution required. You'll have to keep the eslint config file till a better solution is implemented though. |
Beta Was this translation helpful? Give feedback.
-
Hey guys, so Biome v2 is finally stable and that means you can now make custom plugins, does Vercel now have plans to give users the option to use biome for |
Beta Was this translation helpful? Give feedback.
-
Hi, I know this discussion is mainly about biome but last week there is also Oxlint that came out in 1.0.0 and it works really well for my turborepo and nextjs codebase. |
Beta Was this translation helpful? Give feedback.
-
It happened: https://nextjs.org/blog/next-15-5#next-lint-deprecation |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
next lint
and move it to its own independent command (e.g.next doctor
)next lint
Non-Goals
Background
The case against eslint and prettier
Eslint is deprecating formatting rules and community momentum for formatting looks set to move from prettier to Biome. Thus, the current "format with prettier, lint with eslint" setup (which has always pain-points due to mutually exclusive rules and setting up two different tools) is looking less attractive in the long term than simply "format and lint with Biome"..
Users can't bring their own linter
Another discussion has raised the case for documenting how to integrate Biome, but this isn't merely a matter of documentation, as I'll explain below.
As of today, starter templates (at least for Turbo) typically configure projects to lint using
next lint
. This prevents users from bringing their own linting setups as linting is dependent on the Next.js CLI.Unfortunately, we can't simply ditch
next lint
, as it does more than just linting. It does some significant (and valuable) doctoring, too.next lint
, as of v14.0.4, does the following:--ext
and a Next-appropriate--cache-location
.typescript
,@types/react
, and@types/node
tsconfig.json
:["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"]
in yourincludes
array{ "name": "next" }
in yourplugins
arraynode_modules
next-env.d.ts
has been generatedsetting(impossible because the value is hard-coded).opts.lintDuringBuild: true
opts.lintDuringBuild: false
(which is the default) and selectingnull
when prompted which config to start with next timenext lint
is run. However, this is interactive, so unless we can find a way to pipe the necessary input into it via the shell, I am not sure how we can automate this.Proposal
next lint
and allow users to use their preferred linter command directly.next doctor
command that users could optionally run as part of their linting step.Beta Was this translation helpful? Give feedback.
All reactions