-
Notifications
You must be signed in to change notification settings - Fork 181
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
Update usage of Stylelint, although without moving to v16 #4608
Conversation
@@ -22,6 +22,9 @@ sonarjs-* | |||
# Visual Studio | |||
.vs/ | |||
|
|||
# VS Code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing VSCode, as if one wants to run Sonar with Connected-Mode the .vscode/settings.json would be different.
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"editor.formatOnSave": true | ||
}, | ||
"sonarlint.connectedMode.project": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is a key "connectionId" that links to a sonarqube instance
*/ | ||
private defineRules() { | ||
for (const key in rules) { | ||
stylelint.rules[key] = rules[key]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here we change the internals of styleline, which is impossible in the next version.
@@ -22,7 +22,7 @@ | |||
import * as stylelint from 'stylelint'; | |||
import { parse } from 'postcss'; | |||
|
|||
const ruleName = 'no-commented-code'; | |||
const ruleName = 'sonar/no-commented-code'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just leaving a comment, that calling styelint.createPlugin doesn't actually register a plugin it only returns an object in a proper format. To correctly introduce a plugin, we need to add plugins
as an option to the linter (as we now do in wrapper.ts)
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Improves #4481
After an initial investigation, turns out Styleint requires esmodules and is incompatible with CommonJs. Let us for now improve the usage of the plugins, as this would also be enforced in the new version of Stylelint - https://github.com/stylelint/stylelint/blob/46f5eaa7c464b56df1a37e516e21d0c64d5058e5/types/stylelint/index.d.ts#L252