-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Closed
Labels
[Status] In ProgressTracking issues with work in progressTracking issues with work in progress[Tool] stylelint config/packages/stylelint-config/packages/stylelint-config[Type] Code QualityIssues or PRs that relate to code qualityIssues or PRs that relate to code quality
Description
The @wordpress/stylelint-config/scss.js configuration attempts to use stylelint-scss, but the package does not declare a dependency or peer dependency on that package.
This happens to work with npm's hoisting due to other dependencies pulling that package in, but will fail with yarn's p'n'p or pnpm with hoisting disabled.
Reproduction
With yarn:
- Create a temporary directory, and cd into it.
echo '{}' > package.jsonyarn set version stableyarn add @wordpress/stylelint-config stylelintecho 'module.exports = { extends: [ "@wordpress/stylelint-config/scss.js" ] };' > stylelint.config.jsyarn exec stylelint .
With pnpm:
- Create a temporary directory, and cd into it.
echo 'hoist-pattern=[]' > .npmrcpnpm add @wordpress/stylelint-config stylelintecho 'module.exports = { extends: [ "@wordpress/stylelint-config/scss.js" ] };' > stylelint.config.jspnpm exec stylelint .
Expected behavior
Stylelint runs (and prints some bogus errors in the non-css files), e.g.
package.json
5:1 ✖ Missed semicolon CssSyntaxError
pnpm-lock.yaml
1:18 ✖ Missed semicolon CssSyntaxError
stylelint.config.js
1:1 ✖ Unexpected unknown type selector "module" selector-type-no-unknown
1:16 ✖ Unexpected unknown type selector "=" selector-type-no-unknown
1:20 ✖ Unexpected unknown property "extends" property-no-unknown
✖ 5 problems (5 errors, 0 warnings)
Actual behavior
With yarn:
Error: Could not find "stylelint-scss". Do you need to install the package or use the "configBasedir" option?
at configurationError (file:///home/brad/.yarn/berry/cache/stylelint-npm-16.16.0-9b33c213b3-10c0.zip/node_modules/stylelint/lib/utils/configurationError.mjs:12:49)
at getModulePath (file:///home/brad/.yarn/berry/cache/stylelint-npm-16.16.0-9b33c213b3-10c0.zip/node_modules/stylelint/lib/utils/getModulePath.mjs:29:9)
at toAbsolutePath (file:///home/brad/.yarn/berry/cache/stylelint-npm-16.16.0-9b33c213b3-10c0.zip/node_modules/stylelint/lib/augmentConfig.mjs:154:11)
at Array.map (<anonymous>)
at absolutizePaths (file:///home/brad/.yarn/berry/cache/stylelint-npm-16.16.0-9b33c213b3-10c0.zip/node_modules/stylelint/lib/augmentConfig.mjs:161:44)
at Object.transform (file:///home/brad/.yarn/berry/cache/stylelint-npm-16.16.0-9b33c213b3-10c0.zip/node_modules/stylelint/lib/augmentConfig.mjs:87:27)
at load (/tmp/test/.yarn/__virtual__/cosmiconfig-virtual-4d227ae72c/3/home/brad/.yarn/berry/cache/cosmiconfig-npm-9.0.0-47d78cf275-10c0.zip/node_modules/cosmiconfig/dist/Explorer.js:20:38)
at async Explorer.load (/tmp/test/.yarn/__virtual__/cosmiconfig-virtual-4d227ae72c/3/home/brad/.yarn/berry/cache/cosmiconfig-npm-9.0.0-47d78cf275-10c0.zip/node_modules/cosmiconfig/dist/Explorer.js:23:20)
at async extendConfig (file:///home/brad/.yarn/berry/cache/stylelint-npm-16.16.0-9b33c213b3-10c0.zip/node_modules/stylelint/lib/augmentConfig.mjs:193:19)
at async augmentConfigBasic (file:///home/brad/.yarn/berry/cache/stylelint-npm-16.16.0-9b33c213b3-10c0.zip/node_modules/stylelint/lib/augmentConfig.mjs:58:20)
With pnpm:
Error: Could not find "stylelint-scss". Do you need to install the package or use the "configBasedir" option?
at configurationError (file:///tmp/test/node_modules/.pnpm/[email protected]/node_modules/stylelint/lib/utils/configurationError.mjs:12:49)
at getModulePath (file:///tmp/test/node_modules/.pnpm/[email protected]/node_modules/stylelint/lib/utils/getModulePath.mjs:29:9)
at toAbsolutePath (file:///tmp/test/node_modules/.pnpm/[email protected]/node_modules/stylelint/lib/augmentConfig.mjs:154:11)
at Array.map (<anonymous>)
at absolutizePaths (file:///tmp/test/node_modules/.pnpm/[email protected]/node_modules/stylelint/lib/augmentConfig.mjs:161:44)
at Object.transform (file:///tmp/test/node_modules/.pnpm/[email protected]/node_modules/stylelint/lib/augmentConfig.mjs:87:27)
at load (/tmp/test/node_modules/.pnpm/[email protected]/node_modules/cosmiconfig/dist/Explorer.js:20:38)
at async Explorer.load (/tmp/test/node_modules/.pnpm/[email protected]/node_modules/cosmiconfig/dist/Explorer.js:23:20)
at async extendConfig (file:///tmp/test/node_modules/.pnpm/[email protected]/node_modules/stylelint/lib/augmentConfig.mjs:193:19)
at async augmentConfigBasic (file:///tmp/test/node_modules/.pnpm/[email protected]/node_modules/stylelint/lib/augmentConfig.mjs:58:20)
SainathPoojary
Metadata
Metadata
Assignees
Labels
[Status] In ProgressTracking issues with work in progressTracking issues with work in progress[Tool] stylelint config/packages/stylelint-config/packages/stylelint-config[Type] Code QualityIssues or PRs that relate to code qualityIssues or PRs that relate to code quality