File tree Expand file tree Collapse file tree 1 file changed +17
-14
lines changed Expand file tree Collapse file tree 1 file changed +17
-14
lines changed Original file line number Diff line number Diff line change 1
- import { defineNuxtModule , addVitePlugin , addWebpackPlugin } from '@nuxt/kit'
1
+ import { defineNuxtModule , addVitePlugin , addWebpackPlugin , hasNuxtCompatibility } from '@nuxt/kit'
2
2
import type { Options as VitePlugin } from 'vite-plugin-eslint'
3
3
import type { Options as WebpackPlugin } from 'eslint-webpack-plugin'
4
4
import vitePluginEslint from 'vite-plugin-eslint'
@@ -33,20 +33,23 @@ export default defineNuxtModule<ModuleOptions>({
33
33
return
34
34
}
35
35
36
- nuxt . hooks . hookOnce ( 'builder:watch' , ( _ , path ) => {
37
- const configFiles = [
38
- '.eslintrc' ,
39
- '.eslintrc.js' ,
40
- '.eslintrc.yaml' ,
41
- '.eslintrc.yml' ,
42
- '.eslintrc.json'
43
- ]
36
+ /* waiting nuxt 3.3
37
+ if (hasNuxtCompatibility({ nuxt: '>=3.3' })) {
38
+ nuxt.hooks.hookOnce('builder:watch', (_, path) => {
39
+ const configFiles = [
40
+ '.eslintrc',
41
+ '.eslintrc.js',
42
+ '.eslintrc.yaml',
43
+ '.eslintrc.yml',
44
+ '.eslintrc.json'
45
+ ]
44
46
45
- if ( configFiles . includes ( path ) ) {
46
- // waiting https://github.com/nuxt/nuxt/pull/18641
47
- // nuxt.callHook('restart', { hard: true })
48
- }
49
- } )
47
+ if (configFiles.includes(path)) {
48
+ nuxt.callHook('restart', { hard: true })
49
+ }
50
+ })
51
+ }
52
+ */
50
53
51
54
addVitePlugin ( vitePluginEslint ( options ) , { server : false } )
52
55
You can’t perform that action at this time.
0 commit comments