Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ark120202 committed Oct 30, 2019
1 parent c6e2191 commit b30843b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/rules/no-useless-computed-key.md
@@ -1,4 +1,4 @@
# Disallow unnecessary computed property keys (no-useless-computed-key)
# Disallow unnecessary computed property keys in objects and classes (no-useless-computed-key)

It's unnecessary to use computed properties with literals such as:

Expand Down Expand Up @@ -64,7 +64,7 @@ class Foo {
[0]() {}
['a']() {}
get ['b']() {}
set ['c']() {}
set ['c'](value) {}

static ['a']() {}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-useless-computed-key.js
Expand Up @@ -22,7 +22,7 @@ module.exports = {
type: "suggestion",

docs: {
description: "disallow unnecessary computed property keys in object literals",
description: "disallow unnecessary computed property keys in objects and classes",
category: "ECMAScript 6",
recommended: false,
url: "https://eslint.org/docs/rules/no-useless-computed-key"
Expand Down
1 change: 1 addition & 0 deletions tests/lib/rules/no-useless-computed-key.js
Expand Up @@ -24,6 +24,7 @@ ruleTester.run("no-useless-computed-key", rule, {
"({ [x]: 0 });",
"({ a: 0, [b](){} })",
"({ ['__proto__']: [] })",
{ code: "class Foo { a() {} }", options: [{ enforceForClassMembers: true }] },
{ code: "class Foo { 'a'() {} }", options: [{ enforceForClassMembers: true }] },
{ code: "class Foo { [x]() {} }", options: [{ enforceForClassMembers: true }] },
{ code: "class Foo { ['constructor']() {} }", options: [{ enforceForClassMembers: true }] },
Expand Down

0 comments on commit b30843b

Please sign in to comment.