Skip to content

Commit

Permalink
Docs: add no-dupe-class-members examples with class fields (refs #14857)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjermanovic committed Aug 31, 2021
1 parent b4232d4 commit b72b3dc
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions docs/rules/no-dupe-class-members.md
Expand Up @@ -25,7 +25,6 @@ Examples of **incorrect** code for this rule:

```js
/*eslint no-dupe-class-members: "error"*/
/*eslint-env es6*/

class Foo {
bar() { }
Expand All @@ -37,6 +36,16 @@ class Foo {
get bar() { }
}

class Foo {
bar;
bar;
}

class Foo {
bar;
bar() { }
}

class Foo {
static bar() { }
static bar() { }
Expand All @@ -47,7 +56,6 @@ Examples of **correct** code for this rule:

```js
/*eslint no-dupe-class-members: "error"*/
/*eslint-env es6*/

class Foo {
bar() { }
Expand All @@ -59,6 +67,16 @@ class Foo {
set bar(value) { }
}

class Foo {
bar;
qux;
}

class Foo {
bar;
qux() { }
}

class Foo {
static bar() { }
bar() { }
Expand Down

0 comments on commit b72b3dc

Please sign in to comment.