Skip to content

Commit

Permalink
Enable no-new eslint rule (#411)
Browse files Browse the repository at this point in the history
  • Loading branch information
toasted-nutbread authored Dec 21, 2023
1 parent 7dcf023 commit f041f80
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"no-const-assign": "error",
"no-constant-condition": "off",
"no-global-assign": "error",
"no-new": "error",
"no-param-reassign": "off",
"no-prototype-builtins": "error",
"no-shadow": [
Expand Down
1 change: 1 addition & 0 deletions ext/js/pages/settings/profile-conditions-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ export class ProfileConditionsUI extends EventDispatcher {
*/
_validateRegExp(value) {
try {
// eslint-disable-next-line no-new
new RegExp(value, 'i');
return true;
} catch (e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ class TranslationTextReplacementsEntry {
let okay = false;
try {
if (typeof value === 'string') {
// eslint-disable-next-line no-new
new RegExp(value, 'g');
okay = true;
}
Expand Down

0 comments on commit f041f80

Please sign in to comment.