-
-
Notifications
You must be signed in to change notification settings - Fork 929
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix URL metadata for plugins #6245
Comments
@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 stylelint/docs/developer-guide/plugins.md Lines 53 to 55 in e424be5
but the built-in rules are using a single stylelint/lib/rules/alpha-value-notation/index.js Lines 203 to 206 in e424be5
I think we should make it work in both cases. Maybe, we may need to fix the following code: stylelint/lib/lintPostcssResult.js Line 100 in b013ac0
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. |
I checked these Plugins' Libraries, but it doesn't work even using a single module.exports: stylelint-scss/selector-no-redundant-nesting-selector Is there any other possibility? |
@Reda011 Umm..., it seems the $ cat package.json
{
"dependencies": {
"stylelint": "14.9.1",
"stylelint-config-recommended-scss": "7.0.0"
},
"stylelint": {
"extends": "stylelint-config-recommended-scss"
},
"scripts": {
"test": "stylelint \"*.{css,scss}\" -f verbose"
}
}
$ cat a.scss
@foo{}
$ npm it
...
a.scss
1:1 ✖ Unexpected unknown at-rule "@foo" scss/at-rule-no-unknown
1:5 ✖ Unexpected empty block block-no-empty
1 source checked
/Users/koba/tmp/foo/a.scss
2 problems found
severity level "error": 2
scss/at-rule-no-unknown: 1
block-no-empty: 1
... |
Maybe, some IDEs like VSCode may not support terminal links. See the code of the stylelint/lib/formatters/verboseFormatter.js Lines 138 to 144 in 0bd6976
stylelint/lib/formatters/terminalLink.js Lines 8 to 15 in 0bd6976
See also Hyperlinks in Terminal Emulators |
Look this, I got these messages without terminal command but automatic verification: block-no-empty is a rule, it worked; selector-no-redundant-nesting-selector and at-rule-no-unknown are plugins of stylelint-scss, they didn't work. |
I'm not sure, but it seems a problem with the VSCode extension... 🤔 |
We only recently added the capability for plugins to include optional metadata and none of the ones listed above uses it, including the stylelint-scss plugin pack. However, I locally tested a plugin that does and I saw the same behaviour. We will need to look into this more, perhaps adding the fix suggested in #6245 (comment). |
@jeddy3 Ok, thanks! |
@Reda011 I've opened PR #6264 to fix the plugin document. I think the document is incorrect, not the code. Maybe, the new doc way as below should work for your plugin: 👇🏼 stylelint/docs/developer-guide/plugins.md Lines 16 to 55 in 121a34f
|
My bad. I was looking at a local version of stylelint-scss that was out of date. I hadn't realised @ybiquitous added URL metadata to the SCSS plugin back in May.
I tried this way, but still no success. It may just be a local issue for me. Shall we transfer this issue to the VS Code extension repo? (although it's currently unmaintained) |
Sounds good. 👍🏼 I previously changed the VSCode extension to use the rule metadata (stylelint/vscode-stylelint#375), but it might be insufficient. |
I've opened the issue stylelint/vscode-stylelint#415. |
@Reda011 Resolved in latest version of the VS Code extension: stylelint/vscode-stylelint#416 |
Ok, I'll try it, thanks. |
I updated stylelint's version to 14.10.0, and it worked in my custom plugins library. Thank you(@ybiquitous @jeddy3 ). |
What 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
The text was updated successfully, but these errors were encountered: