Skip to content

Commit

Permalink
ESLint: Added regexp/strict rule (#2944)
Browse files Browse the repository at this point in the history
  • Loading branch information
RunDevelopment authored Jun 27, 2021
1 parent bfd7fde commit e8d3b50
Show file tree
Hide file tree
Showing 99 changed files with 148 additions and 144 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ module.exports = {
'regexp/no-useless-lazy': 'warn',
'regexp/prefer-w': 'warn',
'regexp/sort-flags': 'warn',
'regexp/strict': 'warn',

// I turned this rule off because we use `hasOwnProperty` in a lot of places
// TODO: Think about re-enabling this rule
Expand Down
2 changes: 1 addition & 1 deletion assets/code.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ var setTheme;
setTheme = function (id) {
var link = $$('link[href^="themes/prism"]')[0];

link.href = themes.meta.path.replace(/\{id}/g, id);
link.href = themes.meta.path.replace(/\{id\}/g, id);
localStorage.setItem('theme', id);
};

Expand Down
4 changes: 2 additions & 2 deletions assets/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
checked = id === storedTheme;
}

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

var info = all[id] = {
title: all[id].title || all[id],
Expand Down Expand Up @@ -245,7 +245,7 @@
all.meta.link ? {
tag: 'a',
properties: {
href: all.meta.link.replace(/\{id}/g, id),
href: all.meta.link.replace(/\{id\}/g, id),
className: 'name'
},
contents: info.title
Expand Down
4 changes: 2 additions & 2 deletions assets/examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
var language = languages[id];

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

return fileExists(language.examplesPath).then(function (exists) {
return { id: id, exists: exists };
Expand Down
2 changes: 1 addition & 1 deletion components/prism-aql.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Prism.languages.aql = {
lookbehind: true
},
{
pattern: /\bOPTIONS(?=\s*{)/i
pattern: /\bOPTIONS(?=\s*\{)/i
}
],
'function': /\b(?!\d)\w+(?=\s*\()/,
Expand Down
2 changes: 1 addition & 1 deletion components/prism-aql.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion components/prism-cfscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Prism.languages.cfscript = Prism.languages.extend('clike', {
greedy: true
}
],
'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*\=)/,
'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*=)/,
'operator': [
/\+\+|--|&&|\|\||::|=>|[!=]==|<=?|>=?|[-+*/%&|^!=<>]=?|\?(?:\.|:)?|[?:]/,
/\b(?:and|contains|eq|equal|eqv|gt|gte|imp|is|lt|lte|mod|not|or|xor)\b/
Expand Down
2 changes: 1 addition & 1 deletion components/prism-cfscript.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion components/prism-clojure.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion components/prism-clojure.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions components/prism-cmake.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e8d3b50

Please sign in to comment.