Skip to content
代码片段 群组 项目
未验证 提交 b3569a49 编辑于 作者: Mark Florian's avatar Mark Florian
浏览文件

Don't lint ee_component import paths

In
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/85948#note_956238056
it was discovered that we don't actually successfully lint these paths
anyway.

The reason is that it's not a simple resolve alias, which the
`import/no-unresolved` ESLint rule relies upon to look up paths. We
instead use `NormalModuleReplacementPlugin` to rewrite the path when in
FOSS, which that rule does not take into account.

This means that, with `FOSS_ONLY=1`, the resolved path of
`app/assets/javascripts/vue_shared/components/empty_component.js` is not
actually checked.

Since webpack will throw at build time if the path doesn't resolve,
we're protected from typos, so this edge case isn't that important.

Another interesting finding that doesn't quite make sense:
`eslint-module-utils`, which `import/no-unresolved` relies on, only
added support for `import()` calls in v2.6.1 (see
https://github.com/import-js/eslint-plugin-import/pull/2026 and
https://github.com/import-js/eslint-plugin-import/blob/main/utils/CHANGELOG.md#v261---2021-05-13).
See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/85948 for more
discussion about this.
上级 27696c79
No related branches found
No related tags found
无相关合并请求
......@@ -26,6 +26,12 @@ rules:
- _links
import/no-unresolved:
- error
- ignore:
# In FOSS, these import paths are rewritten using
# NormalModuleReplacementPlugin, which import/no-unresolved doesn't
# consider. See
# https://gitlab.com/gitlab-org/gitlab/-/merge_requests/89831.
- '^(ee|jh)_component/'
# Disabled for now, to make the airbnb-base 12.1.0 -> 13.1.0 update smoother
no-else-return:
- error
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册