Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

847
Vistas
node/no-unpublished-import: "chai" is not published

I have a chai among my devDependencies:

"devDependencies": {
    "@types/chai": "4.2.14",
    "chai": "4.2.0",
}

Chai is requires for tests only, but I don't going to publish the test files. The rule node/no-unpublished-import tells me:

"chai" is not published 

From the documentation:

This intends to prevent "Module Not Found" error after npm publish. 💡 If you want to import devDependencies, please write .npmignore or "files" field of package.json.

I did not understand what means "write .npmignore" advice. What I need to write there? Currently, I have below content:

.idea/

/.eslintignore
/.eslintrc.yaml
/.gitignore
/.mocharc.yaml
/.npmignore
/tsconfig.json

**.test.ts

The last one ignores all test files using chai.

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

I'm using require, but the rules are similar:

.eslintrc:

{
  "rules": {
    "node/no-unpublished-require": ["error", {"devDependencies": true}]
  }
}
over 4 years ago · Santiago Trujillo Denunciar

0

You should add this rule to the .eslintrc file:

    "node/no-unpublished-import": ["error", {
      "allowModules": ["chai"]
  }]
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda