Closed atrofimov-sc closed 4 months ago
Hey @atrofimov-sc, please see the first example on the customTypes
docs, points 2 and 3.
I see. For others who're finding this confusing in the documentation, the solution is to specify the dependencyTypes
twice, in the root and in the semver. I.e.
/** @type {import('syncpack').RcFile} */
const config = {
customTypes: {
optional: {
path: 'optionalDependencies',
strategy: 'versionsByName',
},
},
dependencyTypes: ['optional'], // <=== This was missing.
semverGroups: [
{
label: 'Use caret (^) ranges for optional dependencies',
range: '^',
dependencyTypes: ['optional'],
dependencies: ['**'],
packages: ['**'],
},
],
};
module.exports = config;
Thanks @mctrafik, if you have time please submit some edits to the Docs – with my being so close to the implementation maybe I'll gloss over some things, it can happen.
Description
syncpack.js
And then I have a package.json
and I'm expecting it to complain that
*
doesn't match the required range of^
.But it says everything is fine.
Suggested Solution
:shrug:
Help Needed
:shrug: