Skip to content
New issue

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

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

Already on GitHub? # to your account

Add lint rule to disallow require.ensure #1524

Closed
Timer opened this issue Feb 11, 2017 · 3 comments
Closed

Add lint rule to disallow require.ensure #1524

Timer opened this issue Feb 11, 2017 · 3 comments
Milestone

Comments

@Timer
Copy link
Contributor

Timer commented Feb 11, 2017

We need a lint rule that will error when require.ensure is used.
Users should use import() instead.

@tharakawj
Copy link
Contributor

I would like to work on this.

Apparently, there is no such a rule comes with eslint-plugin-import. So I'll send a PR to eslint-plugin-import repo first and update eslint-config-react-app accordingly. Is that the correct path to take on this issue? (I'm asking this because I'm new to open source and this project)

@ljharb
Copy link

ljharb commented Feb 12, 2017

Per import-js/eslint-plugin-import#743 (comment), eslint core already supports no-restricted-properties which can easily block both require.ensure and System.import.

@tharakawj
Copy link
Contributor

@ljharb Thanks for pointing it out. I'll use no-restricted-properties rule and send a PR.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants