Rename function to be more precise
This commit is contained in:
parent
6bd1768b72
commit
fefb8f332c
|
@ -1,7 +1,7 @@
|
|||
/* eslint brace-style: 0, operator-linebreak: 0 */
|
||||
/* global CodeMirror parserlib */
|
||||
/* global exports css_beautify */
|
||||
/* global CSSLint initLint setLinter updateLintReport renderLintReport updateLinter */
|
||||
/* global CSSLint initLint getLinterConfigForCodeMirror updateLintReport renderLintReport updateLinter */
|
||||
'use strict';
|
||||
|
||||
let styleId = null;
|
||||
|
@ -170,7 +170,7 @@ function initCodeMirror() {
|
|||
matchBrackets: true,
|
||||
highlightSelectionMatches: {showToken: /[#.\-\w]/, annotateScrollbar: true},
|
||||
hintOptions: {},
|
||||
lint: setLinter(prefs.get('editor.linter')),
|
||||
lint: getLinterConfigForCodeMirror(prefs.get('editor.linter')),
|
||||
lintReportDelay: prefs.get('editor.lintReportDelay'),
|
||||
styleActiveLine: true,
|
||||
theme: 'default',
|
||||
|
|
|
@ -21,7 +21,7 @@ function setStylelintRules(rules = {}) {
|
|||
BG.chromeLocal.setValue('editorStylelintRules', rules);
|
||||
}
|
||||
|
||||
function setLinter(name) {
|
||||
function getLinterConfigForCodeMirror(name) {
|
||||
return {
|
||||
getAnnotations: CodeMirror.lint[name],
|
||||
delay: prefs.get('editor.lintDelay')
|
||||
|
@ -33,7 +33,7 @@ function updateLinter(name = 'csslint') {
|
|||
prefs.set('editor.linter', name);
|
||||
}
|
||||
editors.forEach(cm => {
|
||||
cm.setOption('lint', setLinter(name));
|
||||
cm.setOption('lint', getLinterConfigForCodeMirror(name));
|
||||
updateLintReport(cm, 200);
|
||||
});
|
||||
$('#stylelint-settings').style.display = name === 'stylelint' ?
|
||||
|
|
Loading…
Reference in New Issue
Block a user