RFC: `modular check`
threepointone opened this issue · comments
modular check <dir?>
a command to check the state of a modular project, and spot warnings/errors. This isn't a lint/typecheck for code, but you could consider it a similar tool for project structure and configuration. It should spit out warnings and errors; it should have a recommended fix for each violation, and it should ideally provide an option to automatically fix it. It isn't meant to be extensible, but we can revisit that decision later.
This issue is about listing every single violation it could detect (which is also a good exercise in enumerating the feature boundaries of modular
)
- error: The root folder must contain a
package.json
with a value:
"modular": {
"type": "root"
}
- warning: the root package.json should have installed
modular-scripts
,eslint-config-modular-app
,eslint
,typescript
,prettier
,react
/react-dom
(and its types) - error: all workspaces must start with
packages
- warning: every path that matches the glob path of
"workspaces"
must have apackage.json
. This file, if possessing a"modular"
field, must have the value{ "type": "view" }
or{ "type": "app" }
- error: there must be a
tsconfig.json
file at the root - warning: the root tsconfig should extend "modular-scripts"
- warning: the root tsconfig should include the src of every workspace at least.
- error: no tsconfig, including the root one, should mark
isolateModules: true
- warning: the root eslint config should extend
"modular-app"
- warning:
.prettierignore
must ignore/dist
, (and all apps'public
?) - warning:
eslintignore
must ignore/dist
- warning: if
@finos/perspective
is installed, you should also install@finos/perspective-webpack-plugin
-
@manypkg/cli
check is a good idea, maybe we should just run that (with opt-out?)
Will keep updating this list as and when, open to ideas.