Allow `npm`-Based Formatters to Pin Transitive Dependencies by Populating `overrides` in `package.json`
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- java, javascript, sql
- Domain
- build-system, tooling
Research direction
Locate PrettierFormatterStep and the code that currently populates devDependencies in the generated package.json. Read how formatter configuration is assembled, then verify that dependencyOverrides is emitted as npm overrides while existing devDependencies behavior remains unchanged.
Written by the indexing model from the issue text.
Description
When using an npm package to format code, and that npm package has a range dependency onto another library, the formatting output can change silently. This just happened to us: we use prettier-plugin-sql, which has a ^-dependency on sql-formatter. sql-formatter released a new version that changed the formatting output, and our project’s build broke because the checked-in SQL files didn’t match the expected format.
Proposal: add the configuration method dependencyOverrides to PrettierFormatterStep. This method accepts a Map<String, String> to populate the overrides field in the generated package.json. This mechanism could work exactly like the one populating the devDependencies.
- Dominant language
- Java
- Stars
- 5.7k
- Forks
- 560
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 43
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from diffplug/spotless
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 66/100
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
All issues in diffplug/spotless
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
area/frontend
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100