Rename function to be more precise

This commit is contained in:
Rob Garrison 2017-08-18 10:39:39 -05:00
parent 6bd1768b72
commit fefb8f332c
2 changed files with 4 additions and 4 deletions

View File

@ -1,7 +1,7 @@
/* eslint brace-style: 0, operator-linebreak: 0 */ /* eslint brace-style: 0, operator-linebreak: 0 */
/* global CodeMirror parserlib */ /* global CodeMirror parserlib */
/* global exports css_beautify */ /* global exports css_beautify */
/* global CSSLint initLint setLinter updateLintReport renderLintReport updateLinter */ /* global CSSLint initLint getLinterConfigForCodeMirror updateLintReport renderLintReport updateLinter */
'use strict'; 'use strict';
let styleId = null; let styleId = null;
@ -170,7 +170,7 @@ function initCodeMirror() {
matchBrackets: true, matchBrackets: true,
highlightSelectionMatches: {showToken: /[#.\-\w]/, annotateScrollbar: true}, highlightSelectionMatches: {showToken: /[#.\-\w]/, annotateScrollbar: true},
hintOptions: {}, hintOptions: {},
lint: setLinter(prefs.get('editor.linter')), lint: getLinterConfigForCodeMirror(prefs.get('editor.linter')),
lintReportDelay: prefs.get('editor.lintReportDelay'), lintReportDelay: prefs.get('editor.lintReportDelay'),
styleActiveLine: true, styleActiveLine: true,
theme: 'default', theme: 'default',

View File

@ -21,7 +21,7 @@ function setStylelintRules(rules = {}) {
BG.chromeLocal.setValue('editorStylelintRules', rules); BG.chromeLocal.setValue('editorStylelintRules', rules);
} }
function setLinter(name) { function getLinterConfigForCodeMirror(name) {
return { return {
getAnnotations: CodeMirror.lint[name], getAnnotations: CodeMirror.lint[name],
delay: prefs.get('editor.lintDelay') delay: prefs.get('editor.lintDelay')
@ -33,7 +33,7 @@ function updateLinter(name = 'csslint') {
prefs.set('editor.linter', name); prefs.set('editor.linter', name);
} }
editors.forEach(cm => { editors.forEach(cm => {
cm.setOption('lint', setLinter(name)); cm.setOption('lint', getLinterConfigForCodeMirror(name));
updateLintReport(cm, 200); updateLintReport(cm, 200);
}); });
$('#stylelint-settings').style.display = name === 'stylelint' ? $('#stylelint-settings').style.display = name === 'stylelint' ?