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
…) (#15005)
  • Loading branch information
mdjermanovic committed Sep 2, 2021
1 parent b4232d4 commit 4338b74
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 4338b74

Please sign in to comment.