diff --git a/edit/lint.js b/edit/lint.js index 8c7b1ad7..802d8196 100644 --- a/edit/lint.js +++ b/edit/lint.js @@ -299,37 +299,50 @@ function toggleLintReport() { } function showLintHelp() { - const makeLink = (url, txt) => `${txt}`; + const makeLink = (href, textContent) => $element({ + tag: 'a', + target: '_blank', + href, + textContent, + }); const linter = prefs.get('editor.linter'); - const url = linter === 'stylelint' + const baseUrl = linter === 'stylelint' ? 'https://stylelint.io/user-guide/rules/' // some CSSLint rules do not have a url : 'https://github.com/CSSLint/csslint/issues/535'; - const rules = []; - let template; - let list = ''); + const header = t('linterIssuesHelp', '\x01').split('\x01'); + const activeRules = new Set($$('#lint td[role="severity"]').map(el => el.dataset.rule)); + return showHelp(t('linterIssues'), + $element({appendChild: [ + header[0], headerLink, header[1], + $element({ + tag: 'ul', + className: 'rules', + appendChild: [...activeRules.values()].map(template), + }), + ]}) + ); } function showLinterErrorMessage(title, contents) {