QuiiBz / sherif

Opinionated, zero-config linter for JavaScript monorepos
MIT License
911 stars 13 forks source link

`packages-without-package-json` - False positives #86

Open Netail opened 3 months ago

Netail commented 3 months ago

Hello, I am getting false-positive errors regarding the packages-without-package-json rule.

{
  "workspaces": [
    "apps/*",
    "packages/*",
    "packages/ui/external/*",
  ]
}

./apps/.npm/package.json doesn't exists; A folder created by NPM ./packages/ui/package.json doesn't exists; a sub-folder used by another workspaces glob, but does not contain source code itself

QuiiBz commented 3 months ago

This behavior is expected, as any folder in e.g. apps/* is considered a package. We could (and maybe should) ignore .npm folders though, and for packages/ui you should update your workspaces configuration to add !packages/ui

Netail commented 3 months ago

We could (and maybe should) ignore .npm folders though

I guess a set of predefined folders to ignore would work :)

Alright, add the exclude glob for the other one

baptisteArno commented 1 month ago

Unfortunately adding !packages/folder in package.json workspaces, will make turborepo ignore all packages under packages/folder 🥲