Skip to content

Commit

Permalink
Use regexp.source
Browse files Browse the repository at this point in the history
  • Loading branch information
Pearce-Ropion committed Sep 3, 2024
1 parent 3c98eb2 commit 2608777
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/rules/jsx-no-literals.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ function trimIfString(value) {
return typeof value === 'string' ? value.trim() : value;
}

const overridableElementPattern = '^[A-Z][\\w.]*$';
const reOverridableElement = new RegExp(overridableElementPattern);
const reOverridableElement = /^[A-Z][\w.]*$/;
const reIsWhiteSpace = /^[\s]+$/;
const jsxElementTypes = new Set(['JSXElement', 'JSXFragment']);
const standardJSXNodeParentTypes = new Set(['JSXAttribute', 'JSXElement', 'JSXExpressionContainer', 'JSXFragment']);
Expand Down Expand Up @@ -190,7 +189,7 @@ module.exports = {
elementOverrides: {
type: 'object',
patternProperties: {
[overridableElementPattern]: {
[reOverridableElement.source]: {
type: 'object',
properties: Object.assign(
{
Expand Down

0 comments on commit 2608777

Please sign in to comment.