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

Conversation

@dannyfritz
Copy link
Contributor

Ruled based off of TSLint's interface-name rule

@dannyfritz dannyfritz mentioned this pull request Oct 23, 2016
31 tasks
@dannyfritz dannyfritz changed the title New: Add rules interface-name-prefix New: Add rule interface-name-prefix Oct 23, 2016
@dannyfritz dannyfritz force-pushed the interface-name-prefix branch from e541167 to 4aa2f30 Compare October 23, 2016 15:56
Copy link
Collaborator

@JamesHenry JamesHenry left a 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:

E.g. http://eslint.org/docs/rules/semi#always

The precedent is also there with the TSLint rule you have referenced.

@dannyfritz
Copy link
Contributor Author

I'll take a look and add it in. Good excuse to learn how to create ESLint rules with options too.

@JamesHenry
Copy link
Collaborator

Hey @dannyfritz, have you had chance to pick this up again?

@dannyfritz
Copy link
Contributor Author

dannyfritz commented Nov 27, 2016 via email

@dannyfritz dannyfritz force-pushed the interface-name-prefix branch 2 times, most recently from 39c2177 to 5493090 Compare December 29, 2016 23:04
@dannyfritz
Copy link
Contributor Author

This is ready for review. 😄

@dannyfritz dannyfritz force-pushed the interface-name-prefix branch from 5493090 to 4a8b76d Compare December 29, 2016 23:07
Copy link
Collaborator

@JamesHenry JamesHenry left a 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?

@dannyfritz dannyfritz force-pushed the interface-name-prefix branch from 4a8b76d to 300b1bb Compare January 2, 2017 02:24
@dannyfritz
Copy link
Contributor Author

Ready for review! 😄

@JamesHenry JamesHenry merged commit 5a2be44 into bradzacher:master Jan 2, 2017
@JamesHenry
Copy link
Collaborator

Thanks!

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.

2 participants