Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Add no-misused-new rule #1963

Merged
merged 2 commits into from Jan 16, 2017
Merged

Conversation

andy-hanson
Copy link
Contributor

@andy-hanson andy-hanson commented Jan 2, 2017

PR checklist

What changes did you make?

Added the misused-new rule, which warns on attempts to define constructable interfaces and to use new in classes. This has come up a few times on DefinitelyTyped.

@andy-hanson andy-hanson changed the title Add no-interface-constructor rule Add misused-new rule Jan 2, 2017
must not have parentheses if removing them is allowed by TypeScript.
options:
type: string
enum:
- ban-single-arg-parens
optionExamples:
- 'true'
- '[true, "ban-single-arg-parens"]'
- '[true, "ban-single-arg-parens]"'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't look intentional.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs is generated, so this is due to an unrelated change (#1947). Made fix in #1967 and filed #1968.

@@ -0,0 +1,5 @@
{
"rules": {
"misused-new": true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's call this no-misused-new to adhere better to existing naming conventions (we usually prefix "no-" to rules that lint against the existence of some code)

@nchen63 nchen63 merged commit 441b2e5 into palantir:master Jan 16, 2017
@nchen63
Copy link
Contributor

nchen63 commented Jan 16, 2017

@andy-hanson thanks!

@andy-hanson andy-hanson deleted the no_interface_constructor branch January 16, 2017 16:29
@nchen63 nchen63 changed the title Add misused-new rule Add no-misused-new rule Jan 25, 2017
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.

None yet

4 participants