Open holic opened 1 year ago
cc @roninjin10 @alvrs
my 2c is templates shouldn't be opinionated on what linter someone uses and we could just remove the linter from them. Or just make them prettier with no config.
Only exception would be if we had a mud specific lint rule
I personally prefer the "linting comes configured out of the box" like Next.js etc. do.
I think we'd still have the same issues if we e.g. let prettier do the "linting"?
Removing linting from templates is certainly the easiest option but my least favorite.
I’m not familiar with lint-staged but can we have it ignore the workspaces and then run individual workspaces seperately
Our monorepo is set up such that we have one root pnpm workspace for all our packages, and a top-level templates directory, each with its own pnpm workspace.
Because each template has its own eslint dependencies and config, husky has a hard time knowing which eslint to use when running on files contained within templates. Even with versions aligned, you get an error like:
I thought I could work around this by moving templates into the root workspace, but that has its own issues because pnpm has a hard time with a workspace-within-a-workspace and running commands within a template (i.e.
pnpm run build
).I think this is because it looks for dependencies at the nearest workspace, but they exist at the root workspace. I'm not sure if there are pnpm settings to work around this, but it feels kinda unsupported.
A potential workaround is remove
pnpm-workspace.yaml
from each template and add them back in when we copy these directories for use in create-mud, but that seems tricky to maintain and ensure things don't break.I unblocked myself on the specific lint issue above by committing with
--no-verify
.Not in love with any of these options, but posting here to brainstorm alternatives.