-
-
Notifications
You must be signed in to change notification settings - Fork 458
Closed
Description
Description
This quote from the README about supporting monorepos:
To support backwards-compatibility, monorepo features require multiple lint-staged configuration files present in the git repo. If you still want to run lint-staged in only one of the packages in a monorepo, you can either add an "empty" lint-staged configuration to the root of the repo (so that there's two configs in total), or alternatively run lint-staged with the --cwd option pointing to your package directory (for example, lint-staged --cwd packages/frontend).
Although when you have an empty config in the root, and another non-empty config in one of the packages, you get this error:
Error: Configuration should not be empty Failed to parse config from file "/<project-path>/.lintstagedrc.js".
Error: Configuration should not be empty
See https://github.com/okonet/lint-staged#configuration.
// .lintstagedrc.js
export default {};// packages/my-package/.lintstagedrc.js
export default {
'**/*.{json,md,yaml,yml}': ['prettier --write'],
'**/*.ts': ['prettier --write', 'eslint --fix'],
};Environment
- OS: macOS 14.4.1
- Node.js: 20.5.0
lint-staged: 15.2.0
Ryan-Freya
Metadata
Metadata
Assignees
Labels
No labels