Replies: 43 comments 29 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.
-
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.
-
Just wanted to point out that since Biome does not currently support custom rules, there is not a clear path to feature parity using biome as an alternative to the next eslint plugin. Until biome supports custom rules or the necessary rules are implemented into core biome, switching to biome as a linter in particular would definitely necessitate sacrificing some of the current features of the eslint plugin. This is obviously not necessarily relevant for other linting tools, but particular to Biome. That being said, disentangling "doctoring" from linting seems like an obvious step forward. Also please stop +1 posting. |
Beta Was this translation helpful? Give feedback.
This comment was marked as disruptive content.
This comment was marked as disruptive content.
-
I'd really love to see some action on this as Biome is much more preferable to me now, and as far as I know to a lot of devs too. Probably, people behind As far as Biome already supports some of the rules from Then, update Next configuration / documentation in order to support Biome as well. Maybe, run Biome instead of ESLint on build if configured etc. See: |
Beta Was this translation helpful? Give feedback.
-
Is there any update on this? After taking some benchmarks, using Biome in my project would on average save 60x of time linting. Would be nice to know if this is denied/on the roadmap etc? |
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.
-
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