Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: add no-dupe-class-members examples with class fields (refs #14857) #15005

Merged
merged 1 commit into from Sep 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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