Skip to content
This repository was archived by the owner on Jan 26, 2019. It is now read-only.

Update member-ordering rule in tslint config #229

Closed
wants to merge 1 commit into from

Conversation

johnrees
Copy link

I'm not 100% about this so please double check, but I think that member-ordering is meant to be in this format.

VSCode was complaining until I made this change.

I used https://palantir.github.io/tslint/rules/member-ordering/ as a reference.

@johnrees
Copy link
Author

Actually this needs another look before merging.

There is a bad member types issue.

@DorianGrey
Copy link
Collaborator

Sorry for the detail ... have been too busy lately.

This currently complains with

Warning: member-ordering - Bad member kind: public-before-private

and does not detect any violation against it. The order values mentioned do not even exist.

Even more curious: The current version works fine, although it should not.

Maybe requires setting up a more detailed list from the current options.

@jessedvrs
Copy link

"public-before-private", "static-before-instance" and "variables-before-functions" are all invalid keys for the order option. I recommend using the following configuration:

"member-ordering": [
    true,
    {
        "order": "statics-first"
    }
],

My motivation:
You can't have publics before privates, statics before instances and variables before functions all at the same time. It's opinionated as all tslint rules are, but I personally prefer statics before instance fields/methods.

@wmonk
Copy link
Owner

wmonk commented Mar 21, 2018

I think this will be superseded by #281?

@DorianGrey
Copy link
Collaborator

It already is, yes.

However, thank you for the effort!

@DorianGrey DorianGrey closed this Apr 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants