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

Added function-constructor rule #4198

Merged
merged 3 commits into from
Dec 13, 2018
Merged

Added function-constructor rule #4198

merged 3 commits into from
Dec 13, 2018

Conversation

JoshuaKGoldberg
Copy link
Contributor

PR checklist

Overview of change:

Blocks using the Function()/new Function() methods to create new functions.

Fixes #3554.

CHANGELOG.md entry:

[new-rule] function-constructor

Josh Goldberg added 2 commits October 2, 2018 17:21
Blocks using the `Function()`/`new Function()` methods to create new functions.

Fixes #3554.
src/configs/all.ts Outdated Show resolved Hide resolved
@ericanderson
Copy link
Member

@JoshuaKGoldberg Since I'm new to maintaining this, I want to make sure we are doing the right things. Doesn't changing "recommended" constitute a break?

@JoshuaKGoldberg
Copy link
Contributor Author

Heya @ericanderson - technically yes, but historically it's had additive changes in patch versions. For example, 5.11.0 added the no-reference-import rule to recommended. IMO this is fine because the recommended/all lists don't come with a guarantee that nothing will be added, as with TypeScript's --strict flag. It'd also be pretty restrictive if those rulesets could only be changed in major versions.

If this were removing a rule from recommend or breaking behavior of an existing rule, I'd feel differently.

Does that sit right with you? I can remove the changed to recommended.ts if you want. 😊

@ericanderson ericanderson merged commit 198bb5a into palantir:master Dec 13, 2018
@JoshuaKGoldberg JoshuaKGoldberg deleted the function-constructor branch December 13, 2018 01:16
@adidahiya
Copy link
Contributor

adidahiya commented Dec 20, 2018

@JoshuaKGoldberg @ericanderson actually, we shouldn't be making tslint:recommended more strict across minor versions, only very obvious bug fixes (like #4072) should cause a change to that rule set. This is documented under "Configuration presets" here: https://palantir.github.io/tslint/usage/configuration/

This configuration follows semver, so it will not have breaking changes across minor or patch releases.

tslint:latest is the rule set which does not follow semver:

Using this config may introduce breaking changes across minor releases as new rules are enabled which cause lint failures in your code.

@JoshuaKGoldberg
Copy link
Contributor Author

Darn, thanks for the clarification @adidahiya!

@ericanderson
Copy link
Member

I wanted to make it less strict :)

@adidahiya
Copy link
Contributor

@ericanderson I agree with that overall goal in v6.0, through #4305

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Port tslint-microsoft-contrib's no-function-constructor-with-string-args
3 participants