Don't lint ee_component import paths
What does this MR do and why?
Don't lint ee_component import paths
In !85948 (comment 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 !85948 (merged) for more
discussion about this.
Screenshots or screen recordings
n/a
How to set up and validate locally
- Run
FOSS_ONLY=1 yarn lint:eslint --no-cache app/assets/javascripts/jobs/components/job_app.vue
- Observe it passes
- Change the
import('ee_component/...')
call to some invalid path - Run the ESLint command again
- Observe it passes
- Remove the
app/assets/javascripts/vue_shared/components/empty_component.js
file - Run the ESLint command again
- Observe it passes
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.