Skip to content

Commit e8d3b50

Browse files
ESLint: Added regexp/strict rule (#2944)
1 parent bfd7fde commit e8d3b50

File tree

99 files changed

+148
-144
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+148
-144
lines changed

.eslintrc.js

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ module.exports = {
7777
'regexp/no-useless-lazy': 'warn',
7878
'regexp/prefer-w': 'warn',
7979
'regexp/sort-flags': 'warn',
80+
'regexp/strict': 'warn',
8081

8182
// I turned this rule off because we use `hasOwnProperty` in a lot of places
8283
// TODO: Think about re-enabling this rule

assets/code.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ var setTheme;
174174
setTheme = function (id) {
175175
var link = $$('link[href^="themes/prism"]')[0];
176176

177-
link.href = themes.meta.path.replace(/\{id}/g, id);
177+
link.href = themes.meta.path.replace(/\{id\}/g, id);
178178
localStorage.setItem('theme', id);
179179
};
180180

assets/download.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@
145145
checked = id === storedTheme;
146146
}
147147

148-
var filepath = all.meta.path.replace(/\{id}/g, id);
148+
var filepath = all.meta.path.replace(/\{id\}/g, id);
149149

150150
var info = all[id] = {
151151
title: all[id].title || all[id],
@@ -245,7 +245,7 @@
245245
all.meta.link ? {
246246
tag: 'a',
247247
properties: {
248-
href: all.meta.link.replace(/\{id}/g, id),
248+
href: all.meta.link.replace(/\{id\}/g, id),
249249
className: 'name'
250250
},
251251
contents: info.title

assets/examples.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
var language = languages[id];
2525

2626
language.enabled = language.option === 'default';
27-
language.path = languages.meta.path.replace(/\{id}/g, id) + '.js';
28-
language.examplesPath = languages.meta.examplesPath.replace(/\{id}/g, id) + '.html';
27+
language.path = languages.meta.path.replace(/\{id\}/g, id) + '.js';
28+
language.examplesPath = languages.meta.examplesPath.replace(/\{id\}/g, id) + '.html';
2929

3030
return fileExists(language.examplesPath).then(function (exists) {
3131
return { id: id, exists: exists };

components/prism-aql.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Prism.languages.aql = {
2626
lookbehind: true
2727
},
2828
{
29-
pattern: /\bOPTIONS(?=\s*{)/i
29+
pattern: /\bOPTIONS(?=\s*\{)/i
3030
}
3131
],
3232
'function': /\b(?!\d)\w+(?=\s*\()/,

components/prism-aql.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/prism-cfscript.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Prism.languages.cfscript = Prism.languages.extend('clike', {
1717
greedy: true
1818
}
1919
],
20-
'keyword': /\b(?:abstract|break|catch|component|continue|default|do|else|extends|final|finally|for|function|if|in|include|package|private|property|public|remote|required|rethrow|return|static|switch|throw|try|var|while|xml)\b(?!\s*\=)/,
20+
'keyword': /\b(?:abstract|break|catch|component|continue|default|do|else|extends|final|finally|for|function|if|in|include|package|private|property|public|remote|required|rethrow|return|static|switch|throw|try|var|while|xml)\b(?!\s*=)/,
2121
'operator': [
2222
/\+\+|--|&&|\|\||::|=>|[!=]==|<=?|>=?|[-+*/%&|^!=<>]=?|\?(?:\.|:)?|[?:]/,
2323
/\b(?:and|contains|eq|equal|eqv|gt|gte|imp|is|lt|lte|mod|not|or|xor)\b/

components/prism-cfscript.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/prism-clojure.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/prism-clojure.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/prism-cmake.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)