QuiiBz / sherif

Opinionated, zero-config linter for JavaScript monorepos
MIT License
912 stars 14 forks source link

Yarn workspace #53

Closed exdeniz closed 9 months ago

exdeniz commented 10 months ago

Yarn can have another format besides the usual workspace config.

// flow type definition:
export type WorkspacesConfig = {
  packages?: Array<string>,
  nohoist?: Array<string>,
};

If the config looks like:

"workspaces": {
  "packages": ["packages/*"],
  "nohoist": ["**/react-native", "**/react-native/**"]
}

Sherif crashes with an error

error Failed to collect packages
Error while parsing "./package.json": invalid type: map, expected a sequence at line 19 column 16
QuiiBz commented 10 months ago

TIL about this format! Do you know if this format is often used? I've personally never heard of it so I'm curious to know if it's something that should be supported or not (based on its usage).

exdeniz commented 10 months ago

Yes, that is the only way to specify nohoist for yarn. Details here

Using the format in projects:

image
QuiiBz commented 9 months ago

Released in https://github.com/QuiiBz/sherif/releases/tag/v0.8.0!