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

Teach "liferay/import-extensions" to check re-exports as well #164

Closed
wincent opened this issue Mar 27, 2020 · 0 comments · Fixed by #165
Closed

Teach "liferay/import-extensions" to check re-exports as well #164

wincent opened this issue Mar 27, 2020 · 0 comments · Fixed by #165
Labels

Comments

@wincent
Copy link
Contributor

wincent commented Mar 27, 2020

Just noticed this one:

export {default as objectToFormData} from './liferay/util/form/object_to_form_data.es.js';

The ".js" here is bad/superfluous. We already have the liferay/import-extensions rule to stop this kind of thing in import statements, so we should extend it to hand the export ... from case as well.

wincent added a commit that referenced this issue Mar 27, 2020
Note that two of the test cases are disabled (for now, will fix in the
next commit) because "espree" doesn't handle "export * as name" syntax.

We are using this syntax in one place in liferay-portal right now:

https://github.com/liferay/liferay-portal/blob/1fd785b60f238666c35609f77c2a0d7c605eefdb/modules/apps/dynamic-data-mapping/dynamic-data-mapping-form-renderer/src/main/resources/META-INF/resources/index.js#L23

And it works there because we use "babel-eslint" as a parser. It would
also work in Clay where we use `@typescript/eslint-parser`, provided we
keep the dep up-to-date.

Closes: #164
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