Skip to content

sheriff treats dependencies from node_modules as modules #205

@marcorinck

Description

@marcorinck

After I have integrated sheriff in our internal application (based on nx and angular), I have seen that sheriff treats some dependencies from package.json (in node_modules) as modules of the application and complains about them when verifying. It does not seem to fail the verify step, but I wonder why this happens?

I can't reproduce this unfortunately in my test project so I can't show it to you. But maybe someone has an idea, what could trigger this? I guess its maybe some kind of weird import?

The config is the same as in my test project here which doesn't have this problem.

Here is the output of verify:

Module /Users/mzrinck/IdeaProjects/InternalProject/node_modules/@angular/cli/node_modules/rxjs/src has both a barrel file (index.ts) and an encapsulated folder (internal) Module /Users/mzrinck/IdeaProjects/InternalProject/node_modules/@angular-devkit/architect/node_modules/rxjs/src has both a barrel file (index.ts) and an encapsulated folder (internal) Module /Users/mzrinck/IdeaProjects/InternalProject/node_modules/@angular-devkit/build-angular/node_modules/rxjs/src has both a barrel file (index.ts) and an encapsulated folder (internal) Module /Users/mzrinck/IdeaProjects/InternalProject/node_modules/@angular-devkit/build-webpack/node_modules/rxjs/src has both a barrel file (index.ts) and an encapsulated folder (internal) Module /Users/mzrinck/IdeaProjects/InternalProject/node_modules/@angular-devkit/core/node_modules/rxjs/src has both a barrel file (index.ts) and an encapsulated folder (internal) Module /Users/mzrinck/IdeaProjects/InternalProject/node_modules/@angular-devkit/schematics/node_modules/rxjs/src has both a barrel file (index.ts) and an encapsulated folder (internal) Module /Users/mzrinck/IdeaProjects/InternalProject/node_modules/@compodoc/compodoc/node_modules/rxjs/src has both a barrel file (index.ts) and an encapsulated folder (internal) Module /Users/mzrinck/IdeaProjects/InternalProject/node_modules/concurrently/node_modules/rxjs/src has both a barrel file (index.ts) and an encapsulated folder (internal) Module /Users/mzrinck/IdeaProjects/InternalProject/node_modules/devextreme-angular/node_modules/rxjs/src has both a barrel file (index.ts) and an encapsulated folder (internal) Module /Users/mzrinck/IdeaProjects/InternalProject/node_modules/devextreme-schematics/node_modules/rxjs/src has both a barrel file (index.ts) and an encapsulated folder (internal) Module /Users/mzrinck/IdeaProjects/InternalProject/node_modules/rxjs/src has both a barrel file (index.ts) and an encapsulated folder (internal) You can disable this warning by setting the property warnOnBarrelFileLessCollision in 'sheriff.config.ts' to false

Here is the relevant part of the module list:

`
....
├── node_modules
├── @angular
└── cli
└── node_modules
└── rxjs
└── src (noTag)
├── ajax (noTag)
├── fetch (noTag)
├── operators (noTag)
├── testing (noTag)
└── webSocket (noTag)
├── @Angular-devkit
├── architect
└── node_modules
└── rxjs
└── src (noTag)
├── ajax (noTag)
├── fetch (noTag)
├── operators (noTag)
├── testing (noTag)
└── webSocket (noTag)
├── build-angular
└── node_modules
└── rxjs
└── src (noTag)
├── ajax (noTag)
├── fetch (noTag)
├── operators (noTag)
├── testing (noTag)
└── webSocket (noTag)
├── build-webpack
└── node_modules
└── rxjs
└── src (noTag)
├── ajax (noTag)
├── fetch (noTag)
├── operators (noTag)
├── testing (noTag)
└── webSocket (noTag)
├── core
└── node_modules
└── rxjs
└── src (noTag)
├── ajax (noTag)
├── fetch (noTag)
├── operators (noTag)
├── testing (noTag)
└── webSocket (noTag)
└── schematics
└── node_modules
└── rxjs
└── src (noTag)
├── ajax (noTag)
├── fetch (noTag)
├── operators (noTag)
├── testing (noTag)
└── webSocket (noTag)
├── @aspnet
└── signalr
└── src (noTag)
├── @babel
├── core
└── src
└── config
└── files (noTag)
└── plugin-transform-runtime
└── src
└── get-runtime-path (noTag)
├── @bcoe
└── v8-coverage
├── dist
└── lib
└── _src (noTag)
└── src
└── lib (noTag)
├── @compodoc
├── compodoc
├── .tmp-compodoc-test-big-app
└── src
└── app (noTag)
├── about (noTag)
├── footer (noTag)
├── header (noTag)
├── home (noTag)
├── list (noTag)
└── todo (noTag)
└── shared
└── components (noTag)
├── .tmp-compodoc-test-unit-test
└── src
└── app (noTag)
├── about (noTag)
├── footer (noTag)
├── header (noTag)
├── home (noTag)
├── list (noTag)
└── todo (noTag)
└── shared
└── components (noTag)
├── node_modules
├── @babel
└── core
└── src
└── config
└── files (noTag)
└── rxjs
└── src (noTag)
├── ajax (noTag)
├── fetch (noTag)
├── operators (noTag)
├── testing (noTag)
└── webSocket (noTag)
├── schematics
└── ng-add (noTag)
└── src (noTag)
├── locales (noTag)
└── utils (noTag)
├── ngd-core
└── src (noTag)
└── ngd-transformer
└── src (noTag)
├── @module-federation
├── bridge-react-webpack-plugin
└── src (noTag)
├── node
└── node_modules
└── @module-federation
├── bridge-react-webpack-plugin
└── src (noTag)
└── runtime-tools
└── src (noTag)
└── runtime-tools
└── src (noTag)
├── @openapi-contrib
└── openapi-schema-to-json-schema
└── src (noTag)
├── @rspack
└── core
└── node_modules
└── @module-federation
└── runtime-tools
└── src (noTag)
├── @swc
└── core
└── node_modules
└── @swc
└── types (noTag)
├── agent-base
└── src (noTag)
├── ajv
└── lib
├── compile (noTag)
├── codegen (noTag)
└── validate (noTag)
├── refs
├── json-schema-2019-09 (noTag)
└── json-schema-2020-12 (noTag)
├── standalone (noTag)
├── types (noTag)
└── vocabularies
├── applicator (noTag)
├── core (noTag)
├── discriminator (noTag)
├── dynamic (noTag)
├── format (noTag)
├── jtd (noTag)
├── unevaluated (noTag)
└── validation (noTag)
├── ajv-formats
└── src (noTag)
├── ajv-keywords
└── src (noTag)
├── definitions (noTag)
└── keywords (noTag)
├── comment-parser
└── src (noTag)
├── parser (noTag)
└── tokenizers (noTag)
├── stringifier (noTag)
└── transforms (noTag)
├── concurrently
└── node_modules
└── rxjs
└── src (noTag)
├── ajax (noTag)
├── fetch (noTag)
├── internal
└── operators (noTag)
├── internal-compatibility (noTag)
├── operators (noTag)
├── testing (noTag)
└── webSocket (noTag)
├── devexpress-diagram
└── dist
└── lib
└── src (noTag)
├── devexpress-gantt
└── dist
└── lib
└── src (noTag)
├── devextreme-angular
└── node_modules
├── ajv
└── lib
├── compile (noTag)
├── codegen (noTag)
└── validate (noTag)
├── refs
├── json-schema-2019-09 (noTag)
└── json-schema-2020-12 (noTag)
├── standalone (noTag)
├── types (noTag)
└── vocabularies
├── applicator (noTag)
├── core (noTag)
├── discriminator (noTag)
├── dynamic (noTag)
├── format (noTag)
├── jtd (noTag)
├── unevaluated (noTag)
└── validation (noTag)
├── ajv-formats
└── src (noTag)
└── rxjs
└── src (noTag)
├── ajax (noTag)
├── fetch (noTag)
├── operators (noTag)
├── testing (noTag)
└── webSocket (noTag)
├── devextreme-schematics
├── node_modules
├── ajv
└── lib
├── compile (noTag)
├── codegen (noTag)
└── validate (noTag)
├── refs
├── json-schema-2019-09 (noTag)
└── json-schema-2020-12 (noTag)
├── standalone (noTag)
├── types (noTag)
└── vocabularies
├── applicator (noTag)
├── core (noTag)
├── discriminator (noTag)
├── dynamic (noTag)
├── format (noTag)
├── jtd (noTag)
├── unevaluated (noTag)
└── validation (noTag)
├── ajv-formats
└── src (noTag)
└── rxjs
└── src (noTag)
├── ajax (noTag)
├── fetch (noTag)
├── operators (noTag)
├── testing (noTag)
└── webSocket (noTag)
└── src
├── add-app-template (noTag)
├── add-layout (noTag)
└── files
└── src
└── app
├── layouts (noTag)
└── shared
├── components (noTag)
└── services (noTag)
├── add-sample-views (noTag)
├── add-view (noTag)
└── install (noTag)
├── eslint-plugin-import
└── node_modules
└── tsconfig-paths
└── src (noTag)
├── exceljs (noTag)
├── html-entities
└── src (noTag)
├── is-what
└── src (noTag)
├── jsdoc-type-pratt-parser
└── src (noTag)
├── openapi-typescript
└── src (noTag)
└── transform (noTag)
├── piscina
└── src (noTag)
├── task_queue (noTag)
└── worker_pool (noTag)
├── rxjs
└── src (noTag)
├── ajax (noTag)
├── fetch (noTag)
├── operators (noTag)
├── testing (noTag)
└── webSocket (noTag)
├── schema-utils
└── node_modules
└── ajv-formats
└── src (noTag)
├── tsconfig-paths
└── src (noTag)
├── typed-assert
└── src (noTag)
└── webfont
└── templates (noTag)

`

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions