File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6565 "eslint-plugin-unicorn" : " ^55.0.0" ,
6666 "eslint-plugin-vue" : " ^9.27.0" ,
6767 "globals" : " ^15.8.0" ,
68+ "local-pkg" : " ^0.5.0" ,
6869 "pathe" : " ^1.1.2" ,
6970 "tslib" : " ^2.6.3" ,
7071 "vue-eslint-parser" : " ^9.4.3"
Original file line number Diff line number Diff line change @@ -46,7 +46,9 @@ export function createConfigForNuxt(
4646 ignores ( ) ,
4747 javascript ( ) ,
4848 // Make these imports async, as they are optional and imports plugins
49- import ( './configs/typescript' ) . then ( m => m . default ( resolved ) ) ,
49+ resolved . features . typescript !== false
50+ ? import ( './configs/typescript' ) . then ( m => m . default ( resolved ) )
51+ : undefined ,
5052 import ( './configs/vue' ) . then ( m => m . default ( resolved ) ) ,
5153 import ( './configs/import' ) . then ( m => m . default ( resolved ) ) ,
5254 )
Original file line number Diff line number Diff line change @@ -50,9 +50,9 @@ export interface NuxtESLintFeaturesOptions {
5050 stylistic ?: boolean | StylisticCustomizeOptions < true >
5151
5252 /**
53- * Options for TypeScript setup
53+ * Enable TypeScript support. Can also be an object to config the options.
5454 *
55- * @ default true
55+ * By default it enables automatic when `typescript` is installed in the project.
5656 */
5757 typescript ?: boolean | {
5858 /**
Original file line number Diff line number Diff line change 1+ import { isPackageExists } from 'local-pkg'
12import type { NuxtESLintConfigOptions , NuxtESLintConfigOptionsResolved } from '../flat'
23
34export function removeUndefined < T extends object > ( obj : T ) : T {
@@ -31,7 +32,7 @@ export function resolveOptions(
3132 features : {
3233 standalone : true ,
3334 stylistic : false ,
34- typescript : true ,
35+ typescript : isPackageExists ( 'typescript' ) ,
3536 tooling : false ,
3637 ...config . features ,
3738 } ,
Original file line number Diff line number Diff line change @@ -2,13 +2,16 @@ export default defineNuxtConfig({
22 modules : [
33 '../packages/module/src/module' ,
44 ] ,
5+
56 devtools : {
67 enabled : true ,
78 } ,
9+
810 components : [
911 '~/components' ,
1012 { path : '~/components-prefixed' , prefix : 'Prefix' } ,
1113 ] ,
14+
1215 eslint : {
1316 config : {
1417 stylistic : true ,
@@ -18,4 +21,6 @@ export default defineNuxtConfig({
1821 fix : true ,
1922 } ,
2023 } ,
24+
25+ compatibilityDate : '2024-07-27' ,
2126} )
You can’t perform that action at this time.
0 commit comments