Fix URL metadata for plugins
See original GitHub issueWhat steps are needed to reproduce the bug?
I reproduced the question in many Plugins Libraries, such as stylelint-z-index-value-constraint
、stylelint-scss
and so on.
Next, take stylelint-scss
as an example:
step1:
npm i stylelint-scss
in my project;
step2:
creat an test file called test.less
;
fill it with:(from stylelint-scss/ selector-no-redundant-nesting-selector
’s testFile)
called test.less
step3:
.stylelintrc.js
module.exports = { plugins: [ "stylelint-scss", ], rules: { "scss/selector-no-redundant-nesting-selector": true, }, };
step4:
it give me error tips: ‘Unnecessary nesting selector (&) (scss/selector-no-redundant-nesting-selector)Stylelint(scss/selector-no-redundant-nesting-selector)’
But, Stylelint(scss/selector-no-redundant-nesting-selector)
had no url.
What Stylelint configuration is needed to reproduce the bug?
module.exports = { plugins: [ “stylelint-scss”, ], rules: { “scss/selector-no-redundant-nesting-selector”: true, }, };
How did you run Stylelint?
cli
Which version of Stylelint are you using?
“stylelint”: “^14.9.1”,“stylelint-scss”: “^4.3.0”
What did you expect to happen?
I click the error tips “…Stylelint(scss/selector-no-redundant-nesting-selector)”
and I can open the web URL which was set in the library.
What actually happened?
I clicked and I can‘t open the web Url which was set in the library.
Does the bug relate to non-standard syntax?
No response
Proposal to fix the bug
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:16 (10 by maintainers)
I updated stylelint’s version to 14.10.0, and it worked in my custom plugins library.
Thank you(@ybiquitous @jeddy3 ).
@Reda011 Thanks for opening the issue and using the template.
This behavior seems to be due to the mismatch between our doc and code on exporting rules.
The doc instructs using multiple
module.exports
,https://github.com/stylelint/stylelint/blob/e424be5eca77c5532b13147c4a7dad14085a4276/docs/developer-guide/plugins.md?plain=1#L53-L55
but the built-in rules are using a single
module.exports
:https://github.com/stylelint/stylelint/blob/e424be5eca77c5532b13147c4a7dad14085a4276/lib/rules/alpha-value-notation/index.js#L203-L206
I think we should make it work in both cases. Maybe, we may need to fix the following code:
https://github.com/stylelint/stylelint/blob/b013ac0827fede2547ba478e920956ff5739af8e/lib/lintPostcssResult.js#L100
I’ve labeled the issue as ready to implement. Please consider contributing if you have time.
There are steps on how to fix a bug in a rule in the Developer guide.