Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

693
Views
Eslint: Cómo usar eslint-plugin-vue instalado globalmente

Me gustaría usar linter elint-plugin-vue como instalación global ya que uso mucho Docker y es posible que no tenga una carpeta node_modules en la raíz de mis repositorios.
Anteriormente, instalé el linter de esta manera: sudo npm install -g eslint eslint-plugin-vue vue-eslint-parser

Sin embargo, cuando /usr/bin/eslint --ext .vue Footer.vue en ausencia de cualquier carpeta node_modules , obtengo lo siguiente:

 Oops! Something went wrong! :( ESLint: 7.23.0 ESLint couldn't find the plugin "eslint-plugin-vue". (The package "eslint-plugin-vue" was not found when loaded as a Node module from the directory "/home/user".) It's likely that the plugin isn't installed correctly. Try reinstalling by running the following: npm install eslint-plugin-vue@latest --save-dev The plugin "eslint-plugin-vue" was referenced from the config file in "PersonalConfig". If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.

ls -la /usr/lib/node_modules/ | grep lint muestra:

 drwxr-xr-x 7 root root 4096 30. Mär 18:56 eslint drwxr-xr-x 4 root root 4096 30. Mär 18:56 eslint-plugin-vue drwxr-xr-x 8 root root 4096 19. Mär 23:09 jsonlint drwxr-xr-x 3 root root 4096 30. Mär 21:43 vue-eslint-parser

~/.eslintrc :

 { "extends": [ "eslint:recommended", "plugin:vue/vue3-recommended" ] }

El error anterior aparece tan pronto como pongo "plugin:vue/vue3-recommended" dentro de ~/.eslintrc .
¿Hay alguna manera de hacer que esto funcione? Sería genial tener esto como respaldo si el repositorio con el que estoy trabajando no tiene node_modules localmente.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Puede usar el --resolve-plugins-relative-to para cambiar el directorio desde donde se resuelven los complementos.

Por ejemplo, en tu caso:

 eslint . --resolve-plugins-relative-to=/usr/lib/

o puede intentar obtener la ruta dinámicamente

 # Yarn eslint . --resolve-plugins-relative-to=$(yarn global dir) # npm eslint . --resolve-plugins-relative-to=$(npm root -g)
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!