Extend config
Problem
Inside an org with a lot of repos we would like to maintain a consistent code style by sharing formatting/linting configuration files. TSLint, ESLint, TypeScript tsconfig etc. all allow this by specifying an `extends` property that points to another config, resolved by node module resolution algorithm. Meaning it's possible to do this: [code block] The rules get shared, but individual rules can still be overridden where it makes sense for only that project. Just passing the path to the config file also prevents editors from detecting that they should use prettier.
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: Extend config
I'm currently doing it this way in all of my repos to maintain consistent style: [code block] The proposed feature (ref: ESLint config) looks good to me and it seems not hard to implement (use `opts.config`): https://github.com/prettier/prettier/blob/d4768e1336108f2ed672f4d288b1751b9c40c526/src/resolve-config.js#L32
Trust Score
4 verifications
- 1
I'm currently doing it this way in all of my repos to maintain consistent style:
I'm currently doing it this way in all of my repos to maintain consistent style:
- 2
The proposed feature (ref: ESLint config) looks good to me and it seems not hard
The proposed feature (ref: ESLint config) looks good to me and it seems not hard to implement (use `opts.config`): https://github.com/prettier/prettier/blob/d4768e1336108f2ed672f4d288b1751b9c40c526/src/resolve-config.js#L32
Validation
Resolved in prettier/prettier GitHub issue #3146. Community reactions: 5 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep