Skip to content

Commit

Permalink
Addressed change requests.
Browse files Browse the repository at this point in the history
  • Loading branch information
TaLeaMonet committed Sep 15, 2020
1 parent 69671b3 commit 1929be2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/rules/jsx-no-literals.md
Expand Up @@ -26,7 +26,7 @@ var Hello = <div>

## Rule Options

There are three options:
The supported options are:

* `noStrings` (default: `false`) - Enforces no string literals used as children, wrapped or unwrapped.
* `allowedStrings` - An array of unique string values that would otherwise warn, but will be ignored.
Expand Down
3 changes: 1 addition & 2 deletions lib/rules/jsx-no-literals.js
Expand Up @@ -45,7 +45,6 @@ module.exports = {
type: 'boolean'
}
},

additionalProperties: false
}]
},
Expand Down Expand Up @@ -94,7 +93,7 @@ module.exports = {
const parent = getParentIgnoringBinaryExpressions(node);

function isParentNodeStandard() {
if (!/^[\s]+$/.test(node.value) && typeof node.value === 'string' && parent.type.indexOf('JSX') !== -1) {
if (!/^[\s]+$/.test(node.value) && typeof node.value === 'string' && parent.type.includes('JSX')) {
if (config.noAttributeStrings) {
return parent.type === 'JSXAttribute';
}
Expand Down

0 comments on commit 1929be2

Please sign in to comment.