mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-26 06:31:49 +00:00
CLI: update Next.js ESLint config
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'create-fumadocs-app': patch
|
||||
---
|
||||
|
||||
update Next.js ESLint config
|
||||
@@ -5,7 +5,6 @@
|
||||
"description": "Used to track dependency versions in create-fumadocs-app",
|
||||
"dependencies": {
|
||||
"@biomejs/biome": "^2.3.8",
|
||||
"@eslint/eslintrc": "^3.3.3",
|
||||
"@orama/core": "^1.2.13",
|
||||
"eslint": "^9.39.1",
|
||||
"fumadocs-core": "workspace:*",
|
||||
|
||||
@@ -3,30 +3,19 @@ import { pick, writeFile } from '@/utils';
|
||||
import path from 'node:path';
|
||||
import { depVersions } from '@/constants';
|
||||
|
||||
const config = `import { dirname } from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
import { FlatCompat } from '@eslint/eslintrc';
|
||||
const config = `import { defineConfig, globalIgnores } from 'eslint/config';
|
||||
import nextVitals from 'eslint-config-next/core-web-vitals';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
||||
const compat = new FlatCompat({
|
||||
baseDirectory: __dirname,
|
||||
});
|
||||
|
||||
const eslintConfig = [
|
||||
...compat.extends('next/core-web-vitals', 'next/typescript'),
|
||||
{
|
||||
ignores: [
|
||||
'node_modules/**',
|
||||
'.next/**',
|
||||
'out/**',
|
||||
'build/**',
|
||||
'.source/**',
|
||||
'next-env.d.ts',
|
||||
],
|
||||
},
|
||||
];
|
||||
const eslintConfig = defineConfig([
|
||||
...nextVitals,
|
||||
globalIgnores([
|
||||
'.next/**',
|
||||
'out/**',
|
||||
'build/**',
|
||||
'next-env.d.ts',
|
||||
'.source/**',
|
||||
]),
|
||||
]);
|
||||
|
||||
export default eslintConfig;`;
|
||||
|
||||
@@ -44,7 +33,7 @@ export function eslint(): TemplatePlugin {
|
||||
devDependencies: {
|
||||
...packageJson.devDependencies,
|
||||
'eslint-config-next': packageJson.dependencies!.next,
|
||||
...pick(depVersions, ['eslint', '@eslint/eslintrc']),
|
||||
...pick(depVersions, ['eslint']),
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
Generated
-21
@@ -1640,9 +1640,6 @@ importers:
|
||||
'@biomejs/biome':
|
||||
specifier: ^2.3.8
|
||||
version: 2.3.8
|
||||
'@eslint/eslintrc':
|
||||
specifier: ^3.3.3
|
||||
version: 3.3.3
|
||||
'@orama/core':
|
||||
specifier: ^1.2.13
|
||||
version: 1.2.13
|
||||
@@ -3406,10 +3403,6 @@ packages:
|
||||
resolution: {integrity: sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
|
||||
'@eslint/[email protected]':
|
||||
resolution: {integrity: sha512-Kr+LPIUVKz2qkx1HAMH8q1q6azbqBAsXJUxBl/ODDuVPX45Z9DfwB8tPjTi6nNZ8BuM3nbJxC5zCAg5elnBUTQ==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
|
||||
'@eslint/[email protected]':
|
||||
resolution: {integrity: sha512-S26Stp4zCy88tH94QbBv3XCuzRQiZ9yXofEILmglYTh/Ug/a9/umqvgFtYBAo3Lp0nsI/5/qH1CCrbdK3AP1Tw==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
@@ -12742,20 +12735,6 @@ snapshots:
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@eslint/[email protected]':
|
||||
dependencies:
|
||||
ajv: 6.12.6
|
||||
debug: 4.4.3
|
||||
espree: 10.4.0
|
||||
globals: 14.0.0
|
||||
ignore: 5.3.2
|
||||
import-fresh: 3.3.1
|
||||
js-yaml: 4.1.1
|
||||
minimatch: 3.1.2
|
||||
strip-json-comments: 3.1.1
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@eslint/[email protected]': {}
|
||||
|
||||
'@eslint/[email protected]': {}
|
||||
|
||||
Reference in New Issue
Block a user