Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Description
Before You File a Proposal Please Confirm You Have Done The Following...
- I havesearched for related issues and found none that match my proposal.
- I have searched thecurrent rule list and found no rules that match my proposal.
- I haveread the FAQ and my problem is not listed.
My proposal is suitable for this project
- I believe my proposal would be useful to the broader TypeScript community (meaning it is not a niche proposal).
Link to the rule's documentation
https://typescript-eslint.io/rules/member-ordering
Description
Based on my experimentations and also on the documentation, to apply the "default configuration" you have to copy/paste this list:https://typescript-eslint.io/rules/member-ordering/#default-configuration which contains 88 lines.
Adding this in the ESLint config will make it less maintainable and having an option to omit this list and use the default would be preferable.
One idea would be to add a new option calledmemberTypesPreset where you could pickdefault - or maybe even its default value would bedefault and you don't have to specify it.
Or another idea would be that ifmemberTypes: [] (empty array) or, ifmemberTypes is simply omitted, the default configuration is applied.
Fail
---#eslintrc.yamlroot:true #Disablesinheritancefromparentconfig.overrides: #TypeScriptconfigurations-files:-'*.ts'-'*.mts'-'*.cts'-'*.tsx' parser:'@typescript-eslint/parser' parserOptions: project:-'tsconfig.json' extends:-plugin:@typescript-eslint/recommended-plugin:@typescript-eslint/recommended-requiring-type-checking rules: #Checksmembers(classes,interfaces,types)andappliesconsistentordering. # @see https://typescript-eslint.io/rules/member-ordering/'@typescript-eslint/member-ordering':-error-default: memberTypesPreset:default order:alphabetically-case-insensitive
Pass
---#eslintrc.yamlroot:true #Disablesinheritancefromparentconfig.overrides: #TypeScriptconfigurations-files:-'*.ts'-'*.mts'-'*.cts'-'*.tsx' parser:'@typescript-eslint/parser' parserOptions: project:-'tsconfig.json' extends:-plugin:@typescript-eslint/recommended-plugin:@typescript-eslint/recommended-requiring-type-checking rules: #Checksmembers(classes,interfaces,types)andappliesconsistentordering. # @see https://typescript-eslint.io/rules/member-ordering/'@typescript-eslint/member-ordering':-error-default: memberTypes:-signature-public-static-field-protected-static-field-private-static-field-public-decorated-field-protected-decorated-field-private-decorated-field-public-instance-field-protected-instance-field-private-instance-field-public-abstract-field-protected-abstract-field-private-abstract-field-public-field-protected-field-private-field-static-field-instance-field-abstract-field-decorated-field-field-static-initialization-public-constructor-protected-constructor-private-constructor-constructor-public-static-get-protected-static-get-private-static-get-public-decorated-get-protected-decorated-get-private-decorated-get-public-instance-get-protected-instance-get-private-instance-get-public-abstract-get-protected-abstract-get-private-abstract-get-public-get-protected-get-private-get-static-get-instance-get-abstract-get-decorated-get-get-public-static-set-protected-static-set-private-static-set-public-decorated-set-protected-decorated-set-private-decorated-set-public-instance-set-protected-instance-set-private-instance-set-public-abstract-set-protected-abstract-set-private-abstract-set-public-set-protected-set-private-set-static-set-instance-set-abstract-set-decorated-set-set-public-static-method-protected-static-method-private-static-method-public-decorated-method-protected-decorated-method-private-decorated-method-public-instance-method-protected-instance-method-private-instance-method-public-abstract-method-protected-abstract-method-private-abstract-method-public-method-protected-method-private-method-static-method-instance-method-abstract-method-decorated-method-method order:alphabetically-case-insensitive
Additional Info
No response