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

Rule Change: option to not require semicolons after class properties #15381

Closed
1 task
lorenzos opened this issue Dec 2, 2021 · 1 comment
Closed
1 task
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion enhancement This change enhances an existing feature of ESLint rule Relates to ESLint's core rules
Projects

Comments

@lorenzos
Copy link

lorenzos commented Dec 2, 2021

What rule do you want to change?

semi.

What change to do you want to make?

Generate fewer warnings.

How do you think the change should be implemented?

A new option.

Example code

export default class MyClass {

	static a = 0 // <--
	b = 1 // <--
	
	foo() {
		return 2;
	}
	
	bar = () => {
		return 3;
	} // <--

}

What does the rule currently do for this code?

In the example above, semi currently requires semicolons after the declarations of a, b and bar (class properties), but not for foo (method).

What will the rule do after it's changed?

It'd be great to have an option to exclude semicolons checks for class properties, but still requires them everywhere else.

Participation

  • I am willing to submit a pull request to implement this change.

Additional comments

This was actually the previous behavior, before semi was updated to support class properties, I think in #14857.

@lorenzos lorenzos added enhancement This change enhances an existing feature of ESLint rule Relates to ESLint's core rules labels Dec 2, 2021
@eslint-github-bot eslint-github-bot bot added this to Needs Triage in Triage Dec 2, 2021
@lorenzos lorenzos changed the title Rule Change: option to don't require semicolons after class properties Rule Change: option to bot require semicolons after class properties Dec 2, 2021
@lorenzos lorenzos changed the title Rule Change: option to bot require semicolons after class properties Rule Change: option to not require semicolons after class properties Dec 2, 2021
@nzakas
Copy link
Member

nzakas commented Dec 2, 2021

Thanks for the input. As stated in the README, we actually aren't making any further updates to rules that enforce stylistic preferences. If you have a strong preference for such a change, you can always copy the existing rule into a custom rule and make it behave the way you want.

@nzakas nzakas closed this as completed Dec 2, 2021
Triage automation moved this from Needs Triage to Complete Dec 2, 2021
@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators Jun 1, 2022
@eslint-github-bot eslint-github-bot bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Jun 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion enhancement This change enhances an existing feature of ESLint rule Relates to ESLint's core rules
Projects
Archived in project
Triage
Complete
Development

No branches or pull requests

2 participants