From 151bb2b13892969bea17b334e882eb422152c30a Mon Sep 17 00:00:00 2001 From: Kai Date: Fri, 12 Nov 2021 16:26:18 +0100 Subject: [PATCH] [Docs] HTTP => HTTPS --- CHANGELOG.md | 8 ++- README.md | 4 +- docs/rules/boolean-prop-naming.md | 2 +- docs/rules/default-props-match-prop-types.md | 2 +- docs/rules/jsx-curly-spacing.md | 2 +- docs/rules/jsx-no-target-blank.md | 16 +++--- docs/rules/jsx-uses-vars.md | 2 +- docs/rules/no-render-return-value.md | 2 +- docs/rules/no-unused-prop-types.md | 2 +- docs/rules/prefer-stateless-function.md | 2 +- docs/rules/prop-types.md | 2 +- docs/rules/require-default-props.md | 2 +- lib/rules/no-unknown-property.js | 2 +- lib/util/pragma.js | 6 +- lib/util/version.js | 4 +- tests/lib/rules/jsx-no-target-blank.js | 58 ++++++++++---------- 16 files changed, 59 insertions(+), 57 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2869fe3d96..de8b57a2a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # Change Log All notable changes to this project will be documented in this file. -This project adheres to [Semantic Versioning](http://semver.org/). -This change log adheres to standards from [Keep a CHANGELOG](http://keepachangelog.com). +This project adheres to [Semantic Versioning](https://semver.org/). +This change log adheres to standards from [Keep a CHANGELOG](https://keepachangelog.com). ## Unreleased @@ -13,9 +13,11 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel ### Changed * [readme] change [`jsx-runtime`] link from branch to sha ([#3160][] @tatsushitoji) +* [Docs] HTTP => HTTPS ([#3133][] @Schweinepriester) [#3163]: https://github.com/yannickcr/eslint-plugin-react/pull/3163 [#3160]: https://github.com/yannickcr/eslint-plugin-react/pull/3160 +[#3133]: https://github.com/yannickcr/eslint-plugin-react/pull/3133 [#2921]: https://github.com/yannickcr/eslint-plugin-react/pull/2921 ## [7.28.0] - 2021.12.22 @@ -2189,7 +2191,7 @@ React ([#1073][] @jomasti) * Add support for `PureComponent` in [`prefer-stateless-function`][] ([#781][] @tiemevanveen) ### Fixed -* Fix [`jsx-uses-vars`][] to work better with [`prefer-const`](http://eslint.org/docs/rules/prefer-const). You'll need to upgrade to ESLint 3.4.0 to completely fix the compatibility issue ([#716][]) +* Fix [`jsx-uses-vars`][] to work better with [`prefer-const`](https://eslint.org/docs/rules/prefer-const). You'll need to upgrade to ESLint 3.4.0 to completely fix the compatibility issue ([#716][]) * Fix [`require-render-return`][] crash ([#784][]) * Fix related components detection in [`prop-types`][] ([#735][]) * Fix component detection to ignore functions expression without a parent component diff --git a/README.md b/README.md index 13e28d6b8a..8990ac8b61 100644 --- a/README.md +++ b/README.md @@ -262,11 +262,11 @@ This pairs well with the `eslint:all` rule. } ``` -**Note**: These configurations will import `eslint-plugin-react` and enable JSX in [parser options](http://eslint.org/docs/user-guide/configuring#specifying-parser-options). +**Note**: These configurations will import `eslint-plugin-react` and enable JSX in [parser options](https://eslint.org/docs/user-guide/configuring/language-options#specifying-parser-options). # License -`eslint-plugin-react` is licensed under the [MIT License](http://www.opensource.org/licenses/mit-license.php). +`eslint-plugin-react` is licensed under the [MIT License](https://opensource.org/licenses/mit-license.php). [npm-url]: https://npmjs.org/package/eslint-plugin-react diff --git a/docs/rules/boolean-prop-naming.md b/docs/rules/boolean-prop-naming.md index b7610b56bf..3c043ca9c0 100644 --- a/docs/rules/boolean-prop-naming.md +++ b/docs/rules/boolean-prop-naming.md @@ -118,5 +118,5 @@ This value is boolean. It tells if nested props should be validated as well. By ``` [PropTypes]: https://reactjs.org/docs/typechecking-with-proptypes.html -[TypeScript]: http://www.typescriptlang.org/ +[TypeScript]: https://www.typescriptlang.org/ [Flow]: https://flow.org/ diff --git a/docs/rules/default-props-match-prop-types.md b/docs/rules/default-props-match-prop-types.md index 35974d6186..4e0b25bd6f 100644 --- a/docs/rules/default-props-match-prop-types.md +++ b/docs/rules/default-props-match-prop-types.md @@ -196,5 +196,5 @@ If you don't care about stray `defaultsProps` in your components, you can disabl - [Official React documentation on defaultProps](https://facebook.github.io/react/docs/typechecking-with-proptypes.html#default-prop-values) [PropTypes]: https://reactjs.org/docs/typechecking-with-proptypes.html -[TypeScript]: http://www.typescriptlang.org/ +[TypeScript]: https://www.typescriptlang.org/ [Flow]: https://flow.org/ diff --git a/docs/rules/jsx-curly-spacing.md b/docs/rules/jsx-curly-spacing.md index 2a533195e3..9f428f5d81 100644 --- a/docs/rules/jsx-curly-spacing.md +++ b/docs/rules/jsx-curly-spacing.md @@ -219,7 +219,7 @@ Examples of **correct** code for this rule, when configured with `"never"` and ` ; ``` -Please note that spacing of the object literal curly braces themselves is controlled by the built-in [`object-curly-spacing`](http://eslint.org/docs/rules/object-curly-spacing) rule. +Please note that spacing of the object literal curly braces themselves is controlled by the built-in [`object-curly-spacing`](https://eslint.org/docs/rules/object-curly-spacing) rule. ### Shorthand options diff --git a/docs/rules/jsx-no-target-blank.md b/docs/rules/jsx-no-target-blank.md index 40cdc4259e..2cea5e5130 100644 --- a/docs/rules/jsx-no-target-blank.md +++ b/docs/rules/jsx-no-target-blank.md @@ -37,7 +37,7 @@ This rule aims to prevent user generated link hrefs and form actions from creati Examples of **incorrect** code for this rule, when configured with `{ "enforceDynamicLinks": "always" }`: ```jsx -var Hello = +var Hello = var Hello = ``` @@ -45,8 +45,8 @@ Examples of **correct** code for this rule: ```jsx var Hello =

-var Hello = -var Hello = +var Hello = +var Hello = var Hello = var Hello = var Hello = @@ -68,7 +68,7 @@ Spread attributes are a handy way of passing programmatically-generated props to ```jsx const unsafeProps = { - href: "http://example.com", + href: "https://example.com", target: "_blank", }; @@ -88,13 +88,13 @@ Defaults to false. If false, this rule will ignore all spread attributes. If tru When option `forms` is set to `true`, the following is considered an error: ```jsx -var Hello =
; +var Hello =
; ``` When option `links` is set to `true`, the following is considered an error: ```jsx -var Hello = +var Hello = ``` ### Custom link components @@ -104,14 +104,14 @@ This rule supports the ability to use custom components for links, such as ` +var Hello = var Hello = ``` Examples of **correct** code for this rule: ```jsx -var Hello = +var Hello = var Hello = var Hello = var Hello = diff --git a/docs/rules/jsx-uses-vars.md b/docs/rules/jsx-uses-vars.md index a0238f6ff1..4a5e5f1766 100644 --- a/docs/rules/jsx-uses-vars.md +++ b/docs/rules/jsx-uses-vars.md @@ -1,6 +1,6 @@ # Prevent variables used in JSX to be incorrectly marked as unused (react/jsx-uses-vars) -Since 0.17.0 the `eslint` `no-unused-vars` rule does not detect variables used in JSX ([see details](http://eslint.org/blog/2015/03/eslint-0.17.0-released#changes-to-jsxreact-handling)). This rule will find variables used in JSX and mark them as used. +Since 0.17.0 the `eslint` `no-unused-vars` rule does not detect variables used in JSX ([see details](https://eslint.org/blog/2015/03/eslint-0.17.0-released#changes-to-jsxreact-handling)). This rule will find variables used in JSX and mark them as used. This rule only has an effect when the `no-unused-vars` rule is enabled. diff --git a/docs/rules/no-render-return-value.md b/docs/rules/no-render-return-value.md index b528251d14..319bfd142b 100644 --- a/docs/rules/no-render-return-value.md +++ b/docs/rules/no-render-return-value.md @@ -1,6 +1,6 @@ # Prevent usage of the return value of ReactDOM.render (react/no-render-return-value) -> `ReactDOM.render()` currently returns a reference to the root `ReactComponent` instance. However, using this return value is legacy and should be avoided because future versions of React may render components asynchronously in some cases. If you need a reference to the root `ReactComponent` instance, the preferred solution is to attach a [callback ref](http://facebook.github.io/react/docs/more-about-refs.html#the-ref-callback-attribute) to the root element. +> `ReactDOM.render()` currently returns a reference to the root `ReactComponent` instance. However, using this return value is legacy and should be avoided because future versions of React may render components asynchronously in some cases. If you need a reference to the root `ReactComponent` instance, the preferred solution is to attach a [callback ref](https://reactjs.org/docs/refs-and-the-dom.html#callback-refs) to the root element. Source: [ReactDOM documentation](https://facebook.github.io/react/docs/react-dom.html#render) diff --git a/docs/rules/no-unused-prop-types.md b/docs/rules/no-unused-prop-types.md index c9950dbfc5..6ca79d46cc 100644 --- a/docs/rules/no-unused-prop-types.md +++ b/docs/rules/no-unused-prop-types.md @@ -140,5 +140,5 @@ AComponent.propTypes = { ``` [PropTypes]: https://reactjs.org/docs/typechecking-with-proptypes.html -[TypeScript]: http://www.typescriptlang.org/ +[TypeScript]: https://www.typescriptlang.org/ [Flow]: https://flow.org/ diff --git a/docs/rules/prefer-stateless-function.md b/docs/rules/prefer-stateless-function.md index 8c2ede9275..9e283c2652 100644 --- a/docs/rules/prefer-stateless-function.md +++ b/docs/rules/prefer-stateless-function.md @@ -6,7 +6,7 @@ Stateless functional components are simpler than class based components and will This rule will check your class based React components for -* methods/properties other than `displayName`, `propTypes`, `contextTypes`, `defaultProps`, `render` and useless constructor (same detection as `eslint` [no-useless-constructor rule](http://eslint.org/docs/rules/no-useless-constructor)) +* methods/properties other than `displayName`, `propTypes`, `contextTypes`, `defaultProps`, `render` and useless constructor (same detection as `eslint` [no-useless-constructor rule](https://eslint.org/docs/rules/no-useless-constructor)) * instance property other than `this.props` and `this.context` * extension of `React.PureComponent` (if the `ignorePureComponents` flag is true) * presence of `ref` attribute in JSX diff --git a/docs/rules/prop-types.md b/docs/rules/prop-types.md index ce0b1e8f32..2eb2a7fd87 100644 --- a/docs/rules/prop-types.md +++ b/docs/rules/prop-types.md @@ -176,5 +176,5 @@ For now we should detect components created with: * an ES6 class that inherit from `React.Component` or `Component` [PropTypes]: https://reactjs.org/docs/typechecking-with-proptypes.html -[TypeScript]: http://www.typescriptlang.org/ +[TypeScript]: https://www.typescriptlang.org/ [Flow]: https://flow.org/ diff --git a/docs/rules/require-default-props.md b/docs/rules/require-default-props.md index 8feaaf477d..7857710c71 100644 --- a/docs/rules/require-default-props.md +++ b/docs/rules/require-default-props.md @@ -348,5 +348,5 @@ If you don't care about using `defaultProps` for your component's props that are - [Official React documentation on defaultProps](https://facebook.github.io/react/docs/typechecking-with-proptypes.html#default-prop-values) [PropTypes]: https://reactjs.org/docs/typechecking-with-proptypes.html -[TypeScript]: http://www.typescriptlang.org/ +[TypeScript]: https://www.typescriptlang.org/ [Flow]: https://flow.org/ diff --git a/lib/rules/no-unknown-property.js b/lib/rules/no-unknown-property.js index 400b7e15b4..5e2d99ee07 100644 --- a/lib/rules/no-unknown-property.js +++ b/lib/rules/no-unknown-property.js @@ -154,7 +154,7 @@ function getDOMPropertyNames(context) { const tagConvention = /^[a-z][^-]*$/; function isTagName(node) { if (tagConvention.test(node.parent.name.name)) { - // http://www.w3.org/TR/custom-elements/#type-extension-semantics + // https://www.w3.org/TR/custom-elements/#type-extension-semantics return !node.parent.attributes.some((attrNode) => ( attrNode.type === 'JSXAttribute' && attrNode.name.type === 'JSXIdentifier' diff --git a/lib/util/pragma.js b/lib/util/pragma.js index a1cf557362..62c983c3d3 100644 --- a/lib/util/pragma.js +++ b/lib/util/pragma.js @@ -11,7 +11,7 @@ const JS_IDENTIFIER_REGEX = /^[_$a-zA-Z][_$a-zA-Z0-9]*$/; function getCreateClassFromContext(context) { let pragma = 'createReactClass'; - // .eslintrc shared settings (http://eslint.org/docs/user-guide/configuring#adding-shared-settings) + // .eslintrc shared settings (https://eslint.org/docs/user-guide/configuring#adding-shared-settings) if (context.settings.react && context.settings.react.createClass) { pragma = context.settings.react.createClass; } @@ -23,7 +23,7 @@ function getCreateClassFromContext(context) { function getFragmentFromContext(context) { let pragma = 'Fragment'; - // .eslintrc shared settings (http://eslint.org/docs/user-guide/configuring#adding-shared-settings) + // .eslintrc shared settings (https://eslint.org/docs/user-guide/configuring#adding-shared-settings) if (context.settings.react && context.settings.react.fragment) { pragma = context.settings.react.fragment; } @@ -42,7 +42,7 @@ function getFromContext(context) { if (pragmaNode) { const matches = JSX_ANNOTATION_REGEX.exec(pragmaNode.value); pragma = matches[1].split('.')[0]; - // .eslintrc shared settings (http://eslint.org/docs/user-guide/configuring#adding-shared-settings) + // .eslintrc shared settings (https://eslint.org/docs/user-guide/configuring#adding-shared-settings) } else if (context.settings.react && context.settings.react.pragma) { pragma = context.settings.react.pragma; } diff --git a/lib/util/version.js b/lib/util/version.js index 3089ab4665..5fe44ebd09 100644 --- a/lib/util/version.js +++ b/lib/util/version.js @@ -71,7 +71,7 @@ function detectReactVersion(context) { function getReactVersionFromContext(context) { let confVer = '999.999.999'; - // .eslintrc shared settings (http://eslint.org/docs/user-guide/configuring#adding-shared-settings) + // .eslintrc shared settings (https://eslint.org/docs/user-guide/configuring#adding-shared-settings) if (context.settings && context.settings.react && context.settings.react.version) { let settingsVersion = context.settings.react.version; if (settingsVersion === 'detect') { @@ -111,7 +111,7 @@ function detectFlowVersion(context) { function getFlowVersionFromContext(context) { let confVer = '999.999.999'; - // .eslintrc shared settings (http://eslint.org/docs/user-guide/configuring#adding-shared-settings) + // .eslintrc shared settings (https://eslint.org/docs/user-guide/configuring#adding-shared-settings) if (context.settings.react && context.settings.react.flowVersion) { let flowVersion = context.settings.react.flowVersion; if (flowVersion === 'detect') { diff --git a/tests/lib/rules/jsx-no-target-blank.js b/tests/lib/rules/jsx-no-target-blank.js index 65067fee7c..c0ad1518d7 100644 --- a/tests/lib/rules/jsx-no-target-blank.js +++ b/tests/lib/rules/jsx-no-target-blank.js @@ -46,8 +46,8 @@ ruleTester.run('jsx-no-target-blank', rule, { { code: '' }, { code: '' }, { code: '' }, - { code: 's' }, - { code: 's' }, + { code: 's' }, + { code: 's' }, { code: '' }, { code: '' }, { code: '

' }, @@ -127,15 +127,15 @@ ruleTester.run('jsx-no-target-blank', rule, { options: [{ forms: false, links: true }], }, { - code: '
', + code: '
', options: [], }, { - code: '
', + code: '
', options: [{ forms: true }], }, { - code: '
', + code: '
', options: [{ forms: true, links: false }], }, { @@ -144,48 +144,48 @@ ruleTester.run('jsx-no-target-blank', rule, { ]), invalid: parsers.all([ { - code: '', - output: '', + code: '', + output: '', errors: defaultErrors, }, { - code: '', - output: '', + code: '', + output: '', errors: defaultErrors, }, { - code: '', - output: '', + code: '', + output: '', errors: defaultErrors, }, { - code: '', - output: '', + code: '', + output: '', errors: defaultErrors, }, { - code: '', - output: '', + code: '', + output: '', errors: defaultErrors, }, { - code: '', - output: '', + code: '', + output: '', errors: defaultErrors, }, { - code: '', - output: '', + code: '', + output: '', errors: defaultErrors, }, { - code: '', - output: '', + code: '', + output: '', errors: defaultErrors, }, { - code: '', - output: '', + code: '', + output: '', errors: defaultErrors, }, { @@ -248,8 +248,8 @@ ruleTester.run('jsx-no-target-blank', rule, { errors: defaultErrors, }, { - code: '', - output: '', + code: '', + output: '', options: [{ allowReferrer: true }], errors: [{ messageId: 'noTargetBlankWithoutNoopener' }], }, @@ -327,22 +327,22 @@ ruleTester.run('jsx-no-target-blank', rule, { errors: defaultErrors, }, { - code: '
', + code: '
', options: [{ forms: true }], errors: defaultErrors, }, { - code: '
', + code: '
', options: [{ forms: true }], errors: defaultErrors, }, { - code: '
', + code: '
', options: [{ forms: true }], errors: defaultErrors, }, { - code: '
', + code: '
', options: [{ forms: true, links: false }], errors: defaultErrors, },