diff --git a/docs/rules/consistent-destructuring.md b/docs/rules/consistent-destructuring.md index 235671e0ce..bdc6cd708e 100644 --- a/docs/rules/consistent-destructuring.md +++ b/docs/rules/consistent-destructuring.md @@ -2,7 +2,7 @@ 🚫 This rule is _disabled_ in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). -πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). +πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/explicit-length-check.md b/docs/rules/explicit-length-check.md index f9842df00e..decb245355 100644 --- a/docs/rules/explicit-length-check.md +++ b/docs/rules/explicit-length-check.md @@ -2,7 +2,7 @@ πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). -πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). +πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/no-anonymous-default-export.md b/docs/rules/no-anonymous-default-export.md index 8ac3c117fe..8525b946c5 100644 --- a/docs/rules/no-anonymous-default-export.md +++ b/docs/rules/no-anonymous-default-export.md @@ -2,7 +2,7 @@ πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). -πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). +πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/no-array-callback-reference.md b/docs/rules/no-array-callback-reference.md index 7e4a71ca72..035c698225 100644 --- a/docs/rules/no-array-callback-reference.md +++ b/docs/rules/no-array-callback-reference.md @@ -2,7 +2,7 @@ πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). -πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). +πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/no-array-for-each.md b/docs/rules/no-array-for-each.md index 5b626b2c69..e6b01f10a8 100644 --- a/docs/rules/no-array-for-each.md +++ b/docs/rules/no-array-for-each.md @@ -2,7 +2,7 @@ πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). -πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). +πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/no-array-method-this-argument.md b/docs/rules/no-array-method-this-argument.md index e6ffdd0b72..8dea99564a 100644 --- a/docs/rules/no-array-method-this-argument.md +++ b/docs/rules/no-array-method-this-argument.md @@ -2,7 +2,7 @@ πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). -πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). +πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/no-array-push-push.md b/docs/rules/no-array-push-push.md index d3b924b609..914fe9f87e 100644 --- a/docs/rules/no-array-push-push.md +++ b/docs/rules/no-array-push-push.md @@ -2,7 +2,7 @@ πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). -πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). +πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/no-await-in-promise-methods.md b/docs/rules/no-await-in-promise-methods.md index 1da102aa98..e42e16d55d 100644 --- a/docs/rules/no-await-in-promise-methods.md +++ b/docs/rules/no-await-in-promise-methods.md @@ -2,7 +2,7 @@ πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). -πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). +πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/no-for-loop.md b/docs/rules/no-for-loop.md index 696803ba53..4b6d3d5cac 100644 --- a/docs/rules/no-for-loop.md +++ b/docs/rules/no-for-loop.md @@ -2,7 +2,7 @@ πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). -πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). +πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/no-new-array.md b/docs/rules/no-new-array.md index 0cc4171cd1..574513309c 100644 --- a/docs/rules/no-new-array.md +++ b/docs/rules/no-new-array.md @@ -2,7 +2,7 @@ πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). -πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). +πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/no-new-buffer.md b/docs/rules/no-new-buffer.md index 7cfd83d43d..982b7338ae 100644 --- a/docs/rules/no-new-buffer.md +++ b/docs/rules/no-new-buffer.md @@ -2,7 +2,7 @@ πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). -πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). +πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/no-null.md b/docs/rules/no-null.md index 214d694abc..15f5417894 100644 --- a/docs/rules/no-null.md +++ b/docs/rules/no-null.md @@ -2,7 +2,7 @@ πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). -πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). +πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/no-single-promise-in-promise-methods.md b/docs/rules/no-single-promise-in-promise-methods.md index c7fe1754d0..50cb47e4f5 100644 --- a/docs/rules/no-single-promise-in-promise-methods.md +++ b/docs/rules/no-single-promise-in-promise-methods.md @@ -2,7 +2,7 @@ πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). -πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). +πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/no-typeof-undefined.md b/docs/rules/no-typeof-undefined.md index 85dde54fe1..f48a5f84c9 100644 --- a/docs/rules/no-typeof-undefined.md +++ b/docs/rules/no-typeof-undefined.md @@ -2,7 +2,7 @@ πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). -πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). +πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/no-useless-switch-case.md b/docs/rules/no-useless-switch-case.md index aae2844aaa..a4fe0952e9 100644 --- a/docs/rules/no-useless-switch-case.md +++ b/docs/rules/no-useless-switch-case.md @@ -2,7 +2,7 @@ πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). -πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). +πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-array-find.md b/docs/rules/prefer-array-find.md index 398de47429..a36c362958 100644 --- a/docs/rules/prefer-array-find.md +++ b/docs/rules/prefer-array-find.md @@ -2,7 +2,7 @@ πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). -πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). +πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-array-index-of.md b/docs/rules/prefer-array-index-of.md index 539337ba63..59292b0e30 100644 --- a/docs/rules/prefer-array-index-of.md +++ b/docs/rules/prefer-array-index-of.md @@ -2,7 +2,7 @@ πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). -πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). +πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-array-some.md b/docs/rules/prefer-array-some.md index e99a55d059..a579540eb6 100644 --- a/docs/rules/prefer-array-some.md +++ b/docs/rules/prefer-array-some.md @@ -2,7 +2,7 @@ πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). -πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). +πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-at.md b/docs/rules/prefer-at.md index 6cea0ab4ae..1720004a83 100644 --- a/docs/rules/prefer-at.md +++ b/docs/rules/prefer-at.md @@ -2,7 +2,7 @@ πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). -πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). +πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-code-point.md b/docs/rules/prefer-code-point.md index 2e9033e0a6..3ca2de6686 100644 --- a/docs/rules/prefer-code-point.md +++ b/docs/rules/prefer-code-point.md @@ -2,7 +2,7 @@ πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). -πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). +πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-default-parameters.md b/docs/rules/prefer-default-parameters.md index 60080463da..e88d7a483f 100644 --- a/docs/rules/prefer-default-parameters.md +++ b/docs/rules/prefer-default-parameters.md @@ -2,7 +2,7 @@ πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). -πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). +πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-dom-node-remove.md b/docs/rules/prefer-dom-node-remove.md index 790904f6a3..e0373dd47a 100644 --- a/docs/rules/prefer-dom-node-remove.md +++ b/docs/rules/prefer-dom-node-remove.md @@ -2,7 +2,7 @@ πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). -πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). +πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-dom-node-text-content.md b/docs/rules/prefer-dom-node-text-content.md index d2b7f1b194..97755e187b 100644 --- a/docs/rules/prefer-dom-node-text-content.md +++ b/docs/rules/prefer-dom-node-text-content.md @@ -2,7 +2,7 @@ πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). -πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). +πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-export-from.md b/docs/rules/prefer-export-from.md index c89158fb1e..affbc9e9de 100644 --- a/docs/rules/prefer-export-from.md +++ b/docs/rules/prefer-export-from.md @@ -2,7 +2,7 @@ πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). -πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). +πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-includes.md b/docs/rules/prefer-includes.md index 6302e2f166..28a0b8eb9c 100644 --- a/docs/rules/prefer-includes.md +++ b/docs/rules/prefer-includes.md @@ -2,7 +2,7 @@ πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). -πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). +πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-logical-operator-over-ternary.md b/docs/rules/prefer-logical-operator-over-ternary.md index 9e27b686d5..4658bc5d75 100644 --- a/docs/rules/prefer-logical-operator-over-ternary.md +++ b/docs/rules/prefer-logical-operator-over-ternary.md @@ -2,7 +2,7 @@ πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). -πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). +πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-math-trunc.md b/docs/rules/prefer-math-trunc.md index 19779f5580..ca2b711a0d 100644 --- a/docs/rules/prefer-math-trunc.md +++ b/docs/rules/prefer-math-trunc.md @@ -2,7 +2,7 @@ πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). -πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). +πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-module.md b/docs/rules/prefer-module.md index ee6db53e47..b08fb6ba36 100644 --- a/docs/rules/prefer-module.md +++ b/docs/rules/prefer-module.md @@ -2,7 +2,7 @@ πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). -πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). +πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-number-properties.md b/docs/rules/prefer-number-properties.md index 7b1d94cdcb..ace82475e1 100644 --- a/docs/rules/prefer-number-properties.md +++ b/docs/rules/prefer-number-properties.md @@ -2,7 +2,7 @@ πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). -πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). +πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-regexp-test.md b/docs/rules/prefer-regexp-test.md index f012d51be9..ee714ac534 100644 --- a/docs/rules/prefer-regexp-test.md +++ b/docs/rules/prefer-regexp-test.md @@ -2,7 +2,7 @@ πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). -πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). +πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-set-has.md b/docs/rules/prefer-set-has.md index 51a7fd5e0d..f4a5070f13 100644 --- a/docs/rules/prefer-set-has.md +++ b/docs/rules/prefer-set-has.md @@ -2,7 +2,7 @@ πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). -πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). +πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-spread.md b/docs/rules/prefer-spread.md index fc10656610..2f118204b3 100644 --- a/docs/rules/prefer-spread.md +++ b/docs/rules/prefer-spread.md @@ -2,7 +2,7 @@ πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). -πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). +πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-string-starts-ends-with.md b/docs/rules/prefer-string-starts-ends-with.md index ed058dd727..2c41311dd9 100644 --- a/docs/rules/prefer-string-starts-ends-with.md +++ b/docs/rules/prefer-string-starts-ends-with.md @@ -2,7 +2,7 @@ πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). -πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). +πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/prefer-top-level-await.md b/docs/rules/prefer-top-level-await.md index 4cb68a96e6..83a0c4ca7b 100644 --- a/docs/rules/prefer-top-level-await.md +++ b/docs/rules/prefer-top-level-await.md @@ -2,7 +2,7 @@ πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). -πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). +πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/relative-url-style.md b/docs/rules/relative-url-style.md index 1e6f8b8340..822a6b0bee 100644 --- a/docs/rules/relative-url-style.md +++ b/docs/rules/relative-url-style.md @@ -2,7 +2,7 @@ πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). -πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). +πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/require-post-message-target-origin.md b/docs/rules/require-post-message-target-origin.md index 6350ca4697..c1e2645e2d 100644 --- a/docs/rules/require-post-message-target-origin.md +++ b/docs/rules/require-post-message-target-origin.md @@ -2,7 +2,7 @@ 🚫 This rule is _disabled_ in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). -πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). +πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/string-content.md b/docs/rules/string-content.md index 1e00e5cf7d..3a2ea1f3e8 100644 --- a/docs/rules/string-content.md +++ b/docs/rules/string-content.md @@ -2,7 +2,7 @@ 🚫 This rule is _disabled_ in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). -πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). +πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/docs/rules/text-encoding-identifier-case.md b/docs/rules/text-encoding-identifier-case.md index 24da4d486b..f365bbb594 100644 --- a/docs/rules/text-encoding-identifier-case.md +++ b/docs/rules/text-encoding-identifier-case.md @@ -2,7 +2,7 @@ πŸ’Ό This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs). -πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). +πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). diff --git a/readme.md b/readme.md index fac04c3d34..61ce3c5dd7 100644 --- a/readme.md +++ b/readme.md @@ -106,7 +106,7 @@ If you don't use the preset, ensure you use the same `env` and `parserOptions` c πŸ’Ό [Configurations](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs) enabled in.\ βœ… Set in the `recommended` [configuration](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs).\ πŸ”§ Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).\ -πŸ’‘ Manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). +πŸ’‘ Manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). | NameΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  | Description | πŸ’Ό | πŸ”§ | πŸ’‘ | | :----------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :- | :- | :- | diff --git a/rules/prefer-spread.js b/rules/prefer-spread.js index 6a158289eb..27a7921a38 100644 --- a/rules/prefer-spread.js +++ b/rules/prefer-spread.js @@ -6,6 +6,7 @@ const { needsSemicolon, isNodeMatches, isMethodNamed, + hasOptionalChainElement, } = require('./utils/index.js'); const {removeMethodCall} = require('./fix/index.js'); const {isLiteral, isMethodCall} = require('./ast/index.js'); @@ -403,7 +404,8 @@ const create = context => { optionalCall: false, optionalMember: false, }) - && node.callee.object.type !== 'ArrayExpression' + && !isArrayLiteral(node.callee.object) + && !hasOptionalChainElement(node.callee.object) )) { return; } @@ -476,7 +478,7 @@ const create = context => { const resultBySpread = [...value]; hasSameResult = resultBySplit.length === resultBySpread.length - && resultBySplit.every((character, index) => character === resultBySpread[index]); + && resultBySplit.every((character, index) => character === resultBySpread[index]); } const problem = { diff --git a/test/prefer-spread.mjs b/test/prefer-spread.mjs index 7c7eec961b..83edafc383 100644 --- a/test/prefer-spread.mjs +++ b/test/prefer-spread.mjs @@ -312,6 +312,7 @@ test.snapshot({ 'buffer.slice()', 'file.slice()', 'class A {foo() {this.slice()}}', + 'scopeManager?.scopes.slice()', ], invalid: [ 'array.slice()', @@ -320,6 +321,7 @@ test.snapshot({ 'array.slice().slice(1)', 'const copy = array.slice()', '(( (( (( array )).slice ))() ))', + '(scopeManager?.scopes).slice()', // Semicolon outdent` bar() diff --git a/test/snapshots/prefer-spread.mjs.md b/test/snapshots/prefer-spread.mjs.md index 7b8a812b48..86770d14cb 100644 --- a/test/snapshots/prefer-spread.mjs.md +++ b/test/snapshots/prefer-spread.mjs.md @@ -2464,7 +2464,28 @@ Generated by [AVA](https://avajs.dev). | ^^^^^ Prefer the spread operator over \`Array#slice()\`.␊ ` -## invalid(7): bar() foo.slice() +## invalid(7): (scopeManager?.scopes).slice() + +> Input + + `␊ + 1 | (scopeManager?.scopes).slice()␊ + ` + +> Output + + `␊ + 1 | [...(scopeManager?.scopes)]␊ + ` + +> Error 1/1 + + `␊ + > 1 | (scopeManager?.scopes).slice()␊ + | ^^^^^ Prefer the spread operator over \`Array#slice()\`.␊ + ` + +## invalid(8): bar() foo.slice() > Input @@ -2488,7 +2509,7 @@ Generated by [AVA](https://avajs.dev). | ^^^^^ Prefer the spread operator over \`Array#slice()\`.␊ ` -## invalid(8): "".slice() +## invalid(9): "".slice() > Input @@ -2509,7 +2530,7 @@ Generated by [AVA](https://avajs.dev). | ^^^^^ Prefer the spread operator over \`Array#slice()\`.␊ ` -## invalid(9): new Uint8Array([10, 20, 30, 40, 50]).slice() +## invalid(10): new Uint8Array([10, 20, 30, 40, 50]).slice() > Input @@ -2530,7 +2551,7 @@ Generated by [AVA](https://avajs.dev). | ^^^^^ Prefer the spread operator over \`Array#slice()\`.␊ ` -## invalid(10): array.slice(0) +## invalid(11): array.slice(0) > Input @@ -2551,7 +2572,7 @@ Generated by [AVA](https://avajs.dev). | ^^^^^ Prefer the spread operator over \`Array#slice()\`.␊ ` -## invalid(11): array.slice(0b0) +## invalid(12): array.slice(0b0) > Input @@ -2572,7 +2593,7 @@ Generated by [AVA](https://avajs.dev). | ^^^^^ Prefer the spread operator over \`Array#slice()\`.␊ ` -## invalid(12): array.slice(0.00) +## invalid(13): array.slice(0.00) > Input @@ -2593,7 +2614,7 @@ Generated by [AVA](https://avajs.dev). | ^^^^^ Prefer the spread operator over \`Array#slice()\`.␊ ` -## invalid(13): array.slice(0.00, ) +## invalid(14): array.slice(0.00, ) > Input diff --git a/test/snapshots/prefer-spread.mjs.snap b/test/snapshots/prefer-spread.mjs.snap index d930ba9778..51b79f8dd2 100644 Binary files a/test/snapshots/prefer-spread.mjs.snap and b/test/snapshots/prefer-spread.mjs.snap differ