Skip to content

Commit b1d3018

Browse files
committed
fix stylelint config p2
1 parent 0fb2f58 commit b1d3018

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/edit/linter/dialogs.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ export async function showLintConfig() {
2525
return;
2626
}
2727
await import('@/cm/jsonlint-bundle');
28+
isStylelint = linter === 'stylelint';
2829
const config = await getLZValue(LZ_KEY[linter]);
2930
const defaults = DEFAULTS[linter];
3031
const title = t('linterConfigPopupTitle', isStylelint ? 'Stylelint' : 'CSSLint');
3132
const activeRules = new Set(getActiveRules());
32-
isStylelint = linter === 'stylelint';
3333
knownRules = KNOWN_RULES[linter] || (
3434
KNOWN_RULES[linter] = new Set((
3535
isStylelint
@@ -49,9 +49,10 @@ export async function showLintConfig() {
4949
delete cfg[id];
5050
}
5151
}
52-
for (const id of missingRules) {
53-
cfg[id] = isStylelint ? false : 0;
54-
}
52+
// Not adding for stylelint because some rules expect a string value
53+
if (!isStylelint)
54+
for (const id of missingRules)
55+
cfg[id] = 0;
5556
}
5657
defaultConfig[linter] = stringifyConfig(defaults);
5758
popup = showCodeMirrorPopup(title, null, {

0 commit comments

Comments
 (0)