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

Conversation

@wincent
Copy link
Contributor

@wincent wincent commented 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

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 wincent added the feature label May 6, 2020
@wincent
Copy link
Contributor Author

wincent commented May 7, 2020

Tested in liferay-portal:

/Users/greghurrell/code/portal/liferay-portal/modules/apps/frontend-theme/frontend-theme-classic/src/js/main.js
  29:11  error  arrow functions are not allowed  liferay/no-arrow
  30:11  error  arrow functions are not allowed  liferay/no-arrow
  41:12  error  arrow functions are not allowed  liferay/no-arrow

So seems fine to merge this.

@wincent wincent merged commit cc55f6c into master May 7, 2020
@wincent wincent deleted the wincent/no-arrow branch May 7, 2020 09:09
brianchandotcom pushed a commit to brianchandotcom/liferay-portal that referenced this pull request May 7, 2020
Release notes:

    https://github.com/liferay/liferay-npm-tools/releases/tag/liferay-npm-scripts%2Fv32.1.0

Brings in new eslint-config-liferay:

    https://github.com/liferay/eslint-config-liferay/releases/tag/v21.1.0

And preset:

    https://github.com/liferay/liferay-npm-tools/releases/tag/liferay-npm-bundler-preset-liferay-dev%2Fv4.3.1

In other words, a new "no-arrow" rule:

    liferay/eslint-config-liferay#180

And a fix for this problem in the preset:

    liferay/liferay-npm-tools#448

This commit includes fixes for the "no-arrow" rule violations in theme
JS files that don't (currently) go through the same kind of build
transpilation pipeline that our other JS does. This fixes breakage in
IE.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add no-arrow

2 participants