-
Notifications
You must be signed in to change notification settings - Fork 885
Conversation
Thanks for your interest in palantir/tslint, @mprobst! Before we can accept your pull request, you need to sign our contributor license agreement - just visit https://cla.palantir.com/ and follow the instructions. Once you sign, I'll automatically update this pull request. |
Company CLA has been mailed out, as far as I know. |
Not sure what's going on with the CI failure, that seems unrelated to my change? |
Sorry about that, #1511 should've fixed things now if you merge in master |
4c087ae
to
84e64ea
Compare
Rebased. Re CLA, Google has signed the Corporate CLA for all Google employees (including me), and mailed it to opensource@palantir.com. |
Confirmed receipt of the Corporate CLA 👍 |
Friendly ping! :-) |
Sorry for the delay @mprobst. I'm going back on forth if this should just be baked in to the rule instead of another option. I'm hesitant to add too many options, it's sort of a weird set of options as it is. What do you think? |
@@ -39,6 +40,7 @@ export class Rule extends Lint.Rules.AbstractRule { | |||
* \`"${OPTION_LEADING_UNDERSCORE}"\` allows underscores at the beginning (only has an effect if "check-format" specified) | |||
* \`"${OPTION_TRAILING_UNDERSCORE}"\` allows underscores at the end. (only has an effect if "check-format" specified) | |||
* \`"${OPTION_ALLOW_PASCAL_CASE}"\` allows PascalCase in addtion to camelCase. | |||
* \`"${OPTION_ALLOW_ALIASES}"\`: does not check the names of aliases, e.g. allows \`let FooBar = FooBar;\` | |||
* \`"${OPTION_BAN_KEYWORDS}"\`: disallows the use of certain TypeScript keywords (\`any\`, \`Number\`, \`number\`, \`String\`, | |||
\`string\`, \`Boolean\`, \`boolean\`, \`undefined\`) as variable or parameter names.`, | |||
options: { |
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.
If we keep the option, can you add it to the schema below?
This change allows aliasing symbols, as long as the left hand side name is identical to the right hand side name. The use case is interoperating with legacy code that uses namespaces, but still being able to abbreviate long namespaces in an ES6 module: const SomeClass = some.long.namespace.SomeClass; Another use case is exposing enums or other PascalCased objects to a template in an Angular application (or similar environments): class MyCtrl { SomeEnum = SomeEnum; }
84e64ea
to
49cac3f
Compare
@jkillian I think you're right. Please take another look, I removed the option and just made this the default behaviour. There's one tricky thing: if you have |
@mprobst agreed that |
This option allows aliasing symbols, as long as the left hand side name
is identical to the right hand side name.
The use case is interoperating with legacy code that uses namespaces,
but still being able to abbreviate long namespaces in an ES6 module:
Another use case is exposing enums or other PascalCased objects to a
template in an Angular application (or similar environments):