diff --git a/docs/rules/jsx-no-literals.md b/docs/rules/jsx-no-literals.md index e755a18421..56145e9d0c 100644 --- a/docs/rules/jsx-no-literals.md +++ b/docs/rules/jsx-no-literals.md @@ -26,7 +26,7 @@ var Hello =
## 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. diff --git a/lib/rules/jsx-no-literals.js b/lib/rules/jsx-no-literals.js index 1f2ed7de62..21ec54def4 100644 --- a/lib/rules/jsx-no-literals.js +++ b/lib/rules/jsx-no-literals.js @@ -45,7 +45,6 @@ module.exports = { type: 'boolean' } }, - additionalProperties: false }] }, @@ -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'; }