Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESLint: Added regexp/strict rule #2944

Merged
merged 4 commits into from Jun 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc.js
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
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
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
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
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
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.