nuxt-modules / eslint

ESLint module for Nuxt.js
MIT License
160 stars 15 forks source link

refactor: add support for nuxt 3/nuxt bridge #70

Closed ricardogobbosouza closed 1 year ago

ricardogobbosouza commented 2 years ago

This PR enables this module to work for Nuxt Bridge & Nuxt 3. Resoles #75, #69, #78

🔥 Notable changes

duboiss commented 2 years ago

Hey @ricardogobbosouza , when do you plan to merge / release this? Thanks

gkweb commented 2 years ago

Can't wait for this to go through! Will fix having to hack a nuxt bridge migration I'm doing. Thanks heaps.

JuanxCursed commented 2 years ago

+1

alexsaranin commented 2 years ago

+1

YusufcanY commented 2 years ago

+1

bf commented 2 years ago

This would be highly appreciated. What is missing to complete this?

jonatandorozco commented 1 year ago

Any new on this? @ricardogobbosouza

ricardogobbosouza commented 1 year ago

I will get back to work on this module now that we have a more stable version of nuxt v3

TouchSek commented 1 year ago

Nuxt 3 just release stable yesterday, so it should be ready to start all over again, thanks for your effort.

mukundshah commented 1 year ago

Hi, Is this PR mergeable yet?

ricardogobbosouza commented 1 year ago

Hi @mukundshah It's not finished yet

vorjyga commented 1 year ago

Any news?

andrevferreiraa commented 1 year ago

Any news on this?

codecov[bot] commented 1 year ago

Codecov Report

Merging #70 (8a423e8) into main (cd820c0) will decrease coverage by 18.58%. The diff coverage is 82.25%.

:exclamation: Current head 8a423e8 differs from pull request most recent head 2f90e86. Consider uploading reports for the commit 2f90e86 to get more accurate results

@@             Coverage Diff              @@
##              main      #70       +/-   ##
============================================
- Coverage   100.00%   81.42%   -18.58%     
============================================
  Files            2        2               
  Lines           22       70       +48     
  Branches         4        6        +2     
============================================
+ Hits            22       57       +35     
- Misses           0       13       +13     
Impacted Files Coverage Δ
src/module.ts 80.00% <80.70%> (-20.00%) :arrow_down:
playground/nuxt.config.ts 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

MartinX3 commented 1 year ago

@ricardogobbosouza Using nuxt 2 and nuxt bridge results in the following error

 FATAL  nuxt.hooks.hookOnce is not a function                                                                                                                                     19:26:38

  at setup (node_modules/.pnpm/@nuxtjs+eslint-module@4.0.0_47imvc6hy6dc2w6gfpmnntc3hq/node_modules/@nuxtjs/eslint-module/dist/module.mjs:34:16)
  at ModuleContainer.normalizedModule (node_modules/.pnpm/@nuxt+kit@3.2.3/node_modules/@nuxt/kit/dist/index.mjs:167:29)
  at async ModuleContainer.addModule (node_modules/.pnpm/@nuxt+core@2.16.2/node_modules/@nuxt/core/dist/core.js:167:20)
  at async ModuleContainer.ready (node_modules/.pnpm/@nuxt+core@2.16.2/node_modules/@nuxt/core/dist/core.js:36:5)
  at async Nuxt._init (node_modules/.pnpm/@nuxt+core@2.16.2/node_modules/@nuxt/core/dist/core.js:342:5)

 ERROR  Cannot start nuxt:  nuxt.hooks.hookOnce is not a function                                                                                                                 19:26:38

  at setup (node_modules/.pnpm/@nuxtjs+eslint-module@4.0.0_47imvc6hy6dc2w6gfpmnntc3hq/node_modules/@nuxtjs/eslint-module/dist/module.mjs:34:16)
  at ModuleContainer.normalizedModule (node_modules/.pnpm/@nuxt+kit@3.2.3/node_modules/@nuxt/kit/dist/index.mjs:167:29)
  at async ModuleContainer.addModule (node_modules/.pnpm/@nuxt+core@2.16.2/node_modules/@nuxt/core/dist/core.js:167:20)
  at async ModuleContainer.ready (node_modules/.pnpm/@nuxt+core@2.16.2/node_modules/@nuxt/core/dist/core.js:36:5)
  at async Nuxt._init (node_modules/.pnpm/@nuxt+core@2.16.2/node_modules/@nuxt/core/dist/core.js:342:5)

I already removed the node_modules and reinstalled everything again with pnpm.

ricardogobbosouza commented 1 year ago

Thanks @MartinX3

ricardogobbosouza commented 1 year ago

Fixed https://github.com/nuxt-community/eslint-module/pull/80

Deckluhm commented 1 year ago

After upgrading @nuxtjs/eslint-module to v4, I got the following warning while running my Nuxt 2 (non-Bridge) app:

WARN  Module @nuxtjs/eslint-module is disabled due to incompatibility issues:
- [bridge] Nuxt bridge is required

It's unclear to me if v4 is supposed to drop Nuxt 2 support?

Changelog wording makes it sound like it's just adding Nuxt Bridge/3 support but it's also in the "Breaking changes" section so I'm not sure if it's a bug or if it's intended (and maybe just need a slightly clearer changelog wording).

Thanks!

ricardogobbosouza commented 1 year ago

@Deckluhm I will add a readme note.

And yes, v4 needs the bridge

ricardogobbosouza commented 1 year ago

83