You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
minor #18 Setup ESLint, and lint/format files (Kocal)
This PR was squashed before being merged into the main branch.
Discussion
----------
Setup ESLint, and lint/format files
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Tickets | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License | MIT
Hi 👋
We are already using Prettier for the formatting and that's really nice, but using a linter is a must have, especially if it's an open-source project where many people can contribute.
I've configured ESLint (and Prettier) in the root `package.json`, because I saw that Jest were configured in workspaces's `package.json` files, but I can move it in external files if needed.
The ESLint configuration is pretty basic, we extends the recommended configuration and use the [Jest ESLint plugin](https://github.com/jest-community/eslint-plugin-jest#readme).
This PR add 4 new Yarn commands:
- `lint`, run ESLint and fix linting issues
- `format`, run Prettier on `.js`, `.json` and `.md` files, and fix formatting issues
- `check-lint` (for the CI), check if ESLint was run
- `check-format` (for the CI), check if Prettier was run
Each workspaces have a new Yarn command `lint` that will run ESLint locally to the workspace, this way `@babel/eslint-parser` will find the Babel config file used by the workspace, and it won't fail if ESLint was ran in the repository root.
WDYT?
Thanks!
Commits
-------
3716e1c Setup ESLint, and lint/format files
0 commit comments