Skip to content
This repository has been archived by the owner on Sep 30, 2020. It is now read-only.

Add no-arrow #179

Closed
wincent opened this issue May 6, 2020 · 0 comments · Fixed by #180
Closed

Add no-arrow #179

wincent opened this issue May 6, 2020 · 0 comments · Fixed by #180
Assignees
Labels

Comments

@wincent
Copy link
Contributor

wincent commented May 6, 2020

To catch things like this, which added an arrow function in a file that doesn't get transpiled, breaking IE.

We have prefer-arrow-callback set to "off", but that is only part of the solution: it stops ESLint from converting callback functions to arrow functions, but it doesn't stop us from adding arrow functions.

In an ideal world, we wouldn't have any untranspiled JS in liferay-portal, because this kind of exceptionalism has bit us again and again. But in the interim, a "no-arrow" rule that can be selectively applied will provide us with some mitigation.

@wincent wincent added the feature label May 6, 2020
@wincent wincent self-assigned this May 6, 2020
wincent added a commit that referenced this issue May 6, 2020
To be applied selectively where we don't want arrow functions to break
IE when we deliver untranspiled code.

Not a breaking change because it isn't turned on by default.

There are more sophisticated tools out there like:

https://github.com/mysticatea/eslint-plugin-es

Which have autofixes, but we want this to be a temporary measure anyway
(the real fix is transpiling our themes JS) so let's not bring in
another dependency.

Closes: #179
wincent added a commit that referenced this issue May 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant