Skip to content

build: add lint rules banning new-ing of Object, String, Number and Boolean #17432

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 17, 2019

Conversation

josephperrott
Copy link
Member

No description provided.

@josephperrott josephperrott added pr: merge safe target: major This PR is targeted for the next major release labels Oct 17, 2019
@josephperrott josephperrott requested review from jelbourn and a team as code owners October 17, 2019 17:06
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Oct 17, 2019
Copy link
Member

@devversion devversion left a comment

Choose a reason for hiding this comment

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

What's the motivation of doing that? I somehow feel unhappy that we need to bring a whole new set of litn rules int our repo for that 😞

@josephperrott
Copy link
Member Author

The same changes were just proposed for angular/angular and I wanted to create this to match.

The reason for doing the change is that there is no value brought from using these constructors, they all are less performant and/or more code than using the primitives directly.

In terms of having to bring in another set of lint rules, banning new Object isn't in the rules we already had, so I added the rules that we have in angular/angular

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM

@jelbourn jelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Oct 17, 2019
@crisbeto
Copy link
Member

I agree with @devversion that this seems redundant, considering that it hasn't come up before on this repo.

@jelbourn
Copy link
Member

Is there a downside to having these? I don't see it ever coming up, but I don't see a cost to having them anyway

@devversion
Copy link
Member

I don't mind much. I was mostly asking for the motivation of doing this. The downside is that we add more packages which aren't necessarily needed. Also FYI: lint rules like this, visit each identifier most likely and cause overall IDE slow-down (if implemented badly; just in general here).

@jelbourn
Copy link
Member

That's fair. I personally turn off tslint in my IDE because it's waaaaay too aggressive while I'm in the middle of writing something. Like, I know the identifier is unused, I just wrote it 2 seconds ago.

@mmalerba mmalerba merged commit 71ec6e9 into angular:master Oct 17, 2019
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Nov 17, 2019
@josephperrott josephperrott deleted the lint branch March 20, 2020 22:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants