jsdrupal / drupal-admin-ui

This is an admin UI for Drupal, built with JavaScript & React. ⬅️✌️➡️
Other
238 stars 91 forks source link

Place elint dependencies in root workspace #754

Open martinfrances107 opened 5 years ago

martinfrances107 commented 5 years ago

The first rule of yarn club is don't talk about yarn club.

The second rule of yarn club is don't put dependencies in the root work-space.

Indeed if you actually want to override and put dependencies in, then you must do something like

yarn add --ignore-workspace-root-check eslint

From this article .. here is the BUT

https://medium.com/@jsilvax/a-workflow-guide-for-lerna-with-yarn-workspaces-60f97481149d

If you have common dev dependencies, it’s better to specify them in the workspace root package.json. For instance, this can be dependencies like Jest, Husky, Storybook, Eslint, Prettier, etc.

Related to this project here is what I see as a conceptual flaw.

in the root package .. this command

"eslint": "eslint packages/*/src --ext .js,.jsx,.ts,.tsx --max-warnings=0 --fix",

packages/*/src is expanded by the shell script into this list of packages/sub-directories.

admin-ui components extension-points utilities

So formally the linting of files in utilities only works accidentally because of it's sister package admin-ui that contains the eslint dependency.

I intend to come up with a pull request that moves Jest, prettier, storybook and all the eslint packages up into the root.