Skip to content
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

no-new needs exception for Notification api #1197

Closed
juliangruber opened this issue Sep 10, 2018 · 2 comments

Comments

@juliangruber
Copy link

commented Sep 10, 2018

What version of standard?

12.0.1

What operating system, Node.js, and npm version?

macOS, node v10.9.0, npm 6.2.0

What did you expect to happen?

This should pass standard:

const { Notification } = window

new Notification('test')

What actually happened?

I got the error Do not use 'new' for side effects.

Since this API is out of my control, I have to introduce a wrapper like this:

const { Notification } = window

const notify = (...args) => new Notification(...args)

notify('test')
@stale

This comment has been minimized.

Copy link

commented Dec 9, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label Dec 9, 2018

@stale stale bot closed this Dec 16, 2018

@LinusU

This comment has been minimized.

Copy link
Member

commented Dec 17, 2018

@juliangruber sorry that no-one got the time to look at this 😞

https://eslint.org/docs/rules/no-new

The upstream eslint rule doesn't have any configuration for this, so it would be great if you could open an upstream issue to either add the exception there, or allow a list of exceptions to be passed to the rule.

Thanks 🍻

@lock lock bot locked as resolved and limited conversation to collaborators Mar 17, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
2 participants
You can’t perform that action at this time.