ESLint: Added no-var rule (#2837)
This commit is contained in:
parent
b03e7eb0cd
commit
f46938e9ae
10
.eslintrc.js
10
.eslintrc.js
|
@ -4,6 +4,7 @@ module.exports = {
|
|||
extends: 'eslint:recommended',
|
||||
rules: {
|
||||
// stylistic rules
|
||||
'no-var': 'error',
|
||||
'quotes': ['warn', 'single', { avoidEscape: true, allowTemplateLiterals: true }],
|
||||
'semi': 'warn',
|
||||
|
||||
|
@ -48,6 +49,9 @@ module.exports = {
|
|||
},
|
||||
globals: {
|
||||
'Prism': true
|
||||
},
|
||||
rules: {
|
||||
'no-var': 'off'
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -70,6 +74,9 @@ module.exports = {
|
|||
env: {
|
||||
browser: true,
|
||||
node: true
|
||||
},
|
||||
rules: {
|
||||
'no-var': 'off'
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -88,6 +95,9 @@ module.exports = {
|
|||
'$': true,
|
||||
'$$': true,
|
||||
'$u': true
|
||||
},
|
||||
rules: {
|
||||
'no-var': 'off'
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
|
@ -25,8 +25,8 @@ function docsClean() {
|
|||
}
|
||||
|
||||
function docsCreate(cb) {
|
||||
var config = require(jsDoc.config);
|
||||
var files = [jsDoc.readme].concat(jsDoc.files);
|
||||
let config = require(jsDoc.config);
|
||||
let files = [jsDoc.readme].concat(jsDoc.files);
|
||||
src(files, { read: false }).pipe(jsdoc(config, cb));
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ for (const lang in languages) {
|
|||
|
||||
if (languages[lang].aliasTitles) {
|
||||
it('- should have all alias titles registered as alias', function () {
|
||||
var aliases = new Set(toArray(languages[lang].alias));
|
||||
let aliases = new Set(toArray(languages[lang].alias));
|
||||
|
||||
Object.keys(languages[lang].aliasTitles).forEach(id => {
|
||||
if (!aliases.has(id)) {
|
||||
|
@ -40,7 +40,7 @@ for (const lang in languages) {
|
|||
|
||||
it('- should known all aliases', function () {
|
||||
|
||||
var loadedLanguages = new Set(Object.keys(PrismLoader.createInstance(lang).languages));
|
||||
let loadedLanguages = new Set(Object.keys(PrismLoader.createInstance(lang).languages));
|
||||
|
||||
// check that all aliases are defined
|
||||
toArray(languages[lang].alias).forEach(alias => {
|
||||
|
|
|
@ -199,7 +199,7 @@ module.exports = (Prism) => {
|
|||
|
||||
|
||||
root = root || Prism.languages;
|
||||
var grammar = root[inside];
|
||||
let grammar = root[inside];
|
||||
|
||||
if (typeof grammar !== 'object') {
|
||||
throw new Error(`The grammar "${inside}" has to be an 'object' not '${typeof grammar}'.`);
|
||||
|
|
Loading…
Reference in New Issue