diff --git a/CHANGELOG.md b/CHANGELOG.md index 8bd7d07507..0aa9588e97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,8 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange * [`jsx-wrap-multilines`]: add `never` option to prohibit wrapping parens on multiline JSX ([#3668][] @reedws) * [`jsx-filename-extension`]: add `ignoreFilesWithoutCode` option to allow empty files ([#3674][] @burtek) * [`jsx-boolean-value`]: add `assumeUndefinedIsFalse` option ([#3675][] @developer-bandi) +* `linkAttribute` setting, [`jsx-no-target-blank`]: support multiple properties ([#3673][] @burtek) +* [`jsx-no-script-url`]: add `includeFromSettings` option to support `linkAttributes` setting ([#3673][] @burtek) ### Fixed * [`jsx-no-leaked-render`]: preserve RHS parens for multiline jsx elements while fixing ([#3623][] @akulsr0) @@ -32,6 +34,7 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange [#3675]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3675 [#3674]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3674 +[#3673]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3673 [#3668]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3668 [#3666]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3666 [#3662]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3662 diff --git a/README.md b/README.md index 0cda1109c3..9c67ff12b5 100644 --- a/README.md +++ b/README.md @@ -63,12 +63,14 @@ You should also specify settings that will be shared across all the plugin rules "formComponents": [ // Components used as alternatives to
"CustomForm", - {"name": "Form", "formAttribute": "endpoint"} + {"name": "SimpleForm", "formAttribute": "endpoint"}, + {"name": "Form", "formAttribute": ["registerEndpoint", "loginEndpoint"]}, // allows specifying multiple properties if necessary ], "linkComponents": [ // Components used as alternatives to for linking, eg. "Hyperlink", - {"name": "Link", "linkAttribute": "to"} + {"name": "MyLink", "linkAttribute": "to"}, + {"name": "Link", "linkAttribute": ["to", "href"]}, // allows specifying multiple properties if necessary ] } } diff --git a/docs/rules/jsx-no-script-url.md b/docs/rules/jsx-no-script-url.md index 8d4f7c8cd4..11fffdad16 100644 --- a/docs/rules/jsx-no-script-url.md +++ b/docs/rules/jsx-no-script-url.md @@ -23,8 +23,14 @@ Examples of **correct** code for this rule: ``` +This rule takes the `linkComponents` setting into account. + ## Rule Options +This rule accepts array option (optional) and object option (optional). + +### Array option (default `[]`) + ```json { "react/jsx-no-script-url": [ @@ -45,11 +51,11 @@ Examples of **correct** code for this rule: Allows you to indicate a specific list of properties used by a custom component to be checked. -### name +#### name Component name. -### props +#### props List of properties that should be validated. @@ -60,3 +66,37 @@ Examples of **incorrect** code for this rule, when configured with the above opt