This repository has been archived by the owner on Aug 7, 2023. It is now read-only.
🐛 Exclude .babelrc from APM releases (fixes #796) #809
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
It appears that if any file recursively
require
d by the linter-eslint worker includesbabel/register
, then all babel configs through all parent directories of that file are processed.Here is where
babel/register
initsOptionManager
: https://github.com/babel/babel/blob/master/packages/babel-register/src/node.js#L51And here is where
OptionManager
iterates parent dirs: https://github.com/babel/babel/blob/master/packages/babel-core/src/transformation/file/options/build-config-chain.js#L60In #796, this happens specifically when
eslint-import-resolver-webpack
require
s a webpack config that in turnrequire
sbabel/register
.register
initsOptionManager
, which in turn finds and processes all babel configs in parent dirs, and chokes when it cannot find the referenced plugins/presets.Here is where
eslint-import-resolver-webpack
require
s the webpack config (vanilla require): https://github.com/benmosher/eslint-plugin-import/blob/master/resolvers/webpack/index.js#L68Solution
Since the
.babelrc
is going to get processed if it is present in the APM package dir, either.babelrc
file must not be in the isntalled APM packageThis PR does the latter since
.babelrc
seems to be only a build-time config, and not needed to run the plugin. (Locally I have confirmed that simplying deleting the.babelrc
file from the APM package dir fixes #796)Changes
Related
APM/export-ignore: atom/apm#498 (comment)
Closes #796
This change is