jsx-no-script-url
Configuration
Rule Details
Disallow usage of javascript: URLs in JSX attributes. In React 16.9, any URLs starting with javascript: log a warning. In a future major release, React will throw an error if it encounters a javascript: URL.
By default, this rule checks the href attribute of the <a> element. Additional components and attributes can be configured via options.
Examples of incorrect code for this rule:
Examples of correct code for this rule:
Options
This rule accepts an optional array of custom component configurations and an optional object option.
Array option (default [])
Allows you to indicate a specific list of properties used by a custom component to be checked.
Examples of incorrect code with the above options:
Object option
includeFromSettings (default false)
Indicates if the linkComponents config in shared settings should also be taken into account. If enabled, components and properties defined in settings will be added to the list provided in the first option (if provided).
If only settings should be used, the array option can be omitted: