diff --git a/docs/rules/no-useless-rename.md b/docs/rules/no-useless-rename.md index 3675075b2f8..ea38e844b76 100644 --- a/docs/rules/no-useless-rename.md +++ b/docs/rules/no-useless-rename.md @@ -28,13 +28,17 @@ let { foo } = bar; This rule disallows the renaming of import, export, and destructured assignments to the same name. +See Also: + +- [`object-shorthand`](https://eslint.org/docs/rules/object-shorthand) which can enforce this behavior for properties in object literals. + ## Options This rule allows for more fine-grained control with the following options: -* `ignoreImport`: When set to `true`, this rule does not check imports -* `ignoreExport`: When set to `true`, this rule does not check exports -* `ignoreDestructuring`: When set to `true`, this rule does not check destructuring assignments +- `ignoreImport`: When set to `true`, this rule does not check imports +- `ignoreExport`: When set to `true`, this rule does not check exports +- `ignoreDestructuring`: When set to `true`, this rule does not check destructuring assignments By default, all options are set to `false`: @@ -117,4 +121,4 @@ You can safely disable this rule if you do not care about redundantly renaming i ## Compatibility -* **JSCS**: [disallowIdenticalDestructuringNames](https://jscs-dev.github.io/rule/disallowIdenticalDestructuringNames) +- **JSCS**: [disallowIdenticalDestructuringNames](https://jscs-dev.github.io/rule/disallowIdenticalDestructuringNames) diff --git a/docs/rules/object-shorthand.md b/docs/rules/object-shorthand.md index 1f2f80db9db..6f2471faf62 100644 --- a/docs/rules/object-shorthand.md +++ b/docs/rules/object-shorthand.md @@ -82,16 +82,20 @@ var foo = { }; ``` +See Also: + +- [`no-useless-rename`](https://eslint.org/docs/rules/object-shorthand) which disallows renaming import, export, and destructured assignments to the same name. + ## Options The rule takes an option which specifies when it should be applied. It can be set to one of the following values: -* `"always"` (default) expects that the shorthand will be used whenever possible. -* `"methods"` ensures the method shorthand is used (also applies to generators). -* `"properties"` ensures the property shorthand is used (where the key and variable name match). -* `"never"` ensures that no property or method shorthand is used in any object literal. -* `"consistent"` ensures that either all shorthand or all long-form will be used in an object literal. -* `"consistent-as-needed"` ensures that either all shorthand or all long-form will be used in an object literal, but ensures all shorthand whenever possible. +- `"always"` (default) expects that the shorthand will be used whenever possible. +- `"methods"` ensures the method shorthand is used (also applies to generators). +- `"properties"` ensures the property shorthand is used (where the key and variable name match). +- `"never"` ensures that no property or method shorthand is used in any object literal. +- `"consistent"` ensures that either all shorthand or all long-form will be used in an object literal. +- `"consistent-as-needed"` ensures that either all shorthand or all long-form will be used in an object literal, but ensures all shorthand whenever possible. You can set the option in configuration like this: @@ -103,9 +107,9 @@ You can set the option in configuration like this: Additionally, the rule takes an optional object configuration: -* `"avoidQuotes": true` indicates that long-form syntax is preferred whenever the object key is a string literal (default: `false`). Note that this option can only be enabled when the string option is set to `"always"`, `"methods"`, or `"properties"`. -* `"ignoreConstructors": true` can be used to prevent the rule from reporting errors for constructor functions. (By default, the rule treats constructors the same way as other functions.) Note that this option can only be enabled when the string option is set to `"always"` or `"methods"`. -* `"avoidExplicitReturnArrows": true` indicates that methods are preferred over explicit-return arrow functions for function properties. (By default, the rule allows either of these.) Note that this option can only be enabled when the string option is set to `"always"` or `"methods"`. +- `"avoidQuotes": true` indicates that long-form syntax is preferred whenever the object key is a string literal (default: `false`). Note that this option can only be enabled when the string option is set to `"always"`, `"methods"`, or `"properties"`. +- `"ignoreConstructors": true` can be used to prevent the rule from reporting errors for constructor functions. (By default, the rule treats constructors the same way as other functions.) Note that this option can only be enabled when the string option is set to `"always"` or `"methods"`. +- `"avoidExplicitReturnArrows": true` indicates that methods are preferred over explicit-return arrow functions for function properties. (By default, the rule allows either of these.) Note that this option can only be enabled when the string option is set to `"always"` or `"methods"`. ### `avoidQuotes`