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

New: Add no-parameter-properties #53

Merged
merged 2 commits into from
Aug 20, 2017

Conversation

weirdpattern
Copy link
Collaborator

This includes

New rule no-parameter-properties
Corresponding test
Corresponding documentation
Update to README.md to include the new rule

Related to #5 (TSLint compatibility)

}

class Foo {
constructor(public readonly name: string) {}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this be allowed if the options are { "allows": ["public", "readonly"] }?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I added accesibility + readonly modifiers as separate options to avoid scenarios like 'I want to allow protected, public and public readonly, but no protected readonly'.

Does that make sense? it did when I was writing it, but I'm open to suggestions...

README.md Outdated
@@ -62,6 +62,7 @@ Then configure the rules you want to use under the rules section.
* [`typescript/member-ordering`](./docs/rules/member-ordering.md) — enforces a standard member declaration order. (`member-ordering` from TSLint)
* [`typescript/no-unused-vars`](./docs/rules/no-unused-vars.md) — prevents TypeScript-specific constructs from being erroneously flagged as unused
* [`typescript/adjacent-overload-signatures`](./docs/rules/adjacent-overload-signatures.md) — enforces member overloads to be consecutive.
* [`typescript/no-parameter-properties`](./docs/rules/no-parameter-properties.md) - disallows parameter properties in class constructors.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you reference the name of the TSLint rule here?

@JamesHenry
Copy link
Collaborator

I resolved the conflicts on here too @weirdpattern, so make sure you pull before continuing to work on it 👍

@weirdpattern weirdpattern force-pushed the no-parameter-properties branch from e4b6fea to b4e069c Compare August 19, 2017 17:33
@weirdpattern
Copy link
Collaborator Author

weirdpattern commented Aug 19, 2017

I did the same as you did, used github to resolve the conflict...

@JamesHenry JamesHenry merged commit 1420cff into bradzacher:master Aug 20, 2017
@dannyfritz dannyfritz mentioned this pull request Aug 20, 2017
31 tasks
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.

3 participants