-
Notifications
You must be signed in to change notification settings - Fork 61
New: Add rule interface-name-prefix #10
Conversation
e541167 to
4aa2f30
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again, @dannyfritz!
I think this is one of those rules which should be implemented with the familiar ESLint "always" vs "never" config:
The precedent is also there with the TSLint rule you have referenced.
|
I'll take a look and add it in. Good excuse to learn how to create ESLint rules with options too. |
|
Hey @dannyfritz, have you had chance to pick this up again? |
|
I still intend to do this. However, the timeline i can commit to is before
New Years if that is alright.
…On Sun, Nov 27, 2016, 04:45 James Henry ***@***.***> wrote:
Hey @dannyfritz <https://github.com/dannyfritz>, have you had chance to
pick this up again?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#10 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AATRjLVyzuR3q8nz3BtxtWsA_upOIkTiks5rCW1ZgaJpZM4KeKqs>
.
|
39c2177 to
5493090
Compare
|
This is ready for review. 😄 |
5493090 to
4a8b76d
Compare
JamesHenry
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the options in!
Now, looking at the implementation, I think we might be better off drawing stronger inspiration from how it is currently done in TSLint: https://github.com/palantir/tslint/blob/d25842e372cbb3ca8ee1f724b5714725d86fb316/src/rules/interfaceNameRule.ts#L55-L105
We are only ever concerned with the first one or two characters of the string, so a RegExp seems overkill.
A final, minor point - TypeScript's official stance on the I prefix is actually not to use it https://github.com/Microsoft/TypeScript/wiki/Coding-guidelines, so could we please go for "never" as the default to match up with that?
4a8b76d to
300b1bb
Compare
|
Ready for review! 😄 |
|
Thanks! |
Ruled based off of TSLint's interface-name rule