Skip to content

Commit da9bef6

Browse files
fix(eslint): Fix ESLint NextJS config
1 parent 096af14 commit da9bef6

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

.changeset/flat-worlds-like.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tcd-devkit/eslint-config-next': patch
3+
---
4+
5+
Fix ESLint NextJS config

eslint.config.mjs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ import { nodePreset } from '@tcd-devkit/eslint-preset-node';
22

33
const config = [
44
...nodePreset,
5+
{
6+
files: ['**/*.{js,jsx,ts,tsx,mjs,cjs}'],
7+
rules: {
8+
'import-x/no-rename-default': ['off'],
9+
},
10+
},
511
{
612
files: ['**/tsup.config.ts', '**/tsup/**/*.ts'],
713
rules: {
@@ -20,7 +26,6 @@ const config = [
2026
'no-restricted-syntax': ['off'],
2127
'@typescript-eslint/no-unsafe-return': ['off'],
2228
'@typescript-eslint/no-unsafe-call': ['off'],
23-
'import-x/no-rename-default': ['off'],
2429
'import-x/no-deprecated': ['off'],
2530
'import-x/no-cycle': ['off'],
2631
},

packages/eslint/eslint-config-next/src/next.linter.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
import { flatConfig as nextPluginConfigs } from '@next/eslint-plugin-next';
1+
import nextPlugin from '@next/eslint-plugin-next';
22
import type { Linter } from 'eslint';
33
import { defineConfig } from 'eslint/config';
44

5+
const { flatConfig: nextPluginConfigs } = nextPlugin;
6+
57
const nextCoreWebVitals = nextPluginConfigs.coreWebVitals as Linter.Config;
68

79
export const nextConfig = defineConfig({

0 commit comments

Comments
 (0)