Skip to content
This repository has been archived by the owner on Jun 8, 2023. It is now read-only.

Use babel's built-in option manager for loading configs #34

Merged
merged 1 commit into from
Dec 26, 2016

Conversation

tleunen
Copy link
Owner

@tleunen tleunen commented Dec 23, 2016

This is a follow up of #28. Thanks @izaakschroeder for the initial code. I just fixed the default cwd to the project root, using pkg-up.

This also means this creates a small breaking change because it forces the paths to be relative to the project root directory (based on package.json), but at least we'll be able to support configuration inside presets.

@izaakschroeder would you mind testing the PR?

@codecov-io
Copy link

codecov-io commented Dec 23, 2016

Current coverage is 100% (diff: 100%)

Merging #34 into master will increase coverage by 2.56%

Diff Coverage File Path
•••••••••• 100% src/index.js

Powered by Codecov. Last update fb3617d...92c1646

@tleunen tleunen changed the title Use 's built-in option manager for loading configs Use babel's built-in option manager for loading configs Dec 23, 2016
@tleunen tleunen force-pushed the feat/babel-builtin-opts branch 5 times, most recently from 73f8972 to 1e16091 Compare December 26, 2016 02:19
@tleunen
Copy link
Owner Author

tleunen commented Dec 26, 2016

It did work well in my case, so I'm merging. This will be part of a v3, since instead of being relative to babelrc file, this must be relative to package.json file by default. Even tho in most cases this is the case, maybe there were custom edge cases where it was not. So it will be safer to release it as v3.

I'll also make sure to check if the babel plugin also requires an update.

@tleunen tleunen merged commit c526927 into master Dec 26, 2016
@tleunen tleunen deleted the feat/babel-builtin-opts branch December 26, 2016 02:31
@slorber
Copy link

slorber commented Dec 4, 2019

Hi @tleunen

I got this error that gives a link to this PR, yet I'm not really able to understand how this PR is related to the error I get.

image

I'm trying to lint a RN app with sources in ./src, and have both babel/eslint plugins configured to do so.
Is there another issue that explains my errors? Where should I use "module:react-native" exactly?

@tleunen
Copy link
Owner Author

tleunen commented Dec 4, 2019

Seems you forgot to include babel-preset-react-native in your project?

We have a big try catch around babel so we catch other errors unrelated to the plugin unfortunately :s

@izaakschroeder
Copy link
Contributor

Yea this error basically means: babel encountered some error, we don't really know what to do! We provide the error thrown which you can see at the top there 😄

@slorber
Copy link

slorber commented Dec 5, 2019

I'm using https://github.com/satya164/eslint-config-satya164 in a RN context and I am able to transpile my project normally, so I normally have all the dependencies needed.

Note in RN, libraries are shipped not transpiled and Metro does transpile node_module libraries too (unlike web where libs tend to be published already transpiled). Can it be the cause? How can we tell this plugin to also babel transpile what is in node modules? because here it seems related to one of my lib

If this plugin have a big try catch, isn't it possible to log the original error that cause the issue? It seems like I don't have the "root cause" of the error here

@slorber
Copy link

slorber commented Dec 5, 2019

I was wrong apparently this is the root cause.

I'm using https://github.com/expo/expo/tree/master/packages/babel-preset-expo

I think it's actually because I'm using babel.config.js instead of .babelrc: #89

Edit: apparently just adding "babel-preset-react-native" as direct devDependency did solve the issue for me :) not sure why it's not a dep of the expo preset (which extends metro rn preset).

@sdandois
Copy link

sdandois commented Oct 14, 2020

Edit: apparently just adding "babel-preset-react-native" as direct devDependency did solve the issue for me :) not sure why it's not a dep of the expo preset (which extends metro rn preset).

This worked to me too. I guess it is not a dep because is already deprecated. I think that you may be using an old module which it is using it in its metro-bundle-config, but it is not a dependency because they guessed that all react-native projects would already have it.

zurbergram added a commit to department-of-veterans-affairs/vets-website that referenced this pull request May 25, 2021
zurbergram added a commit to department-of-veterans-affairs/vets-website that referenced this pull request May 25, 2021
zurbergram added a commit to department-of-veterans-affairs/vets-website that referenced this pull request May 26, 2021
…ion search #23686 (#17247)

* Name search autocomplete

* Create mapboxToken.js

* fetchSearchByLocationResults

* cleanup

* cleanup

* set state correctly at beginning of action

* AC 3

* rmeove countries from mapbox call

* Search updates

* Reducer cleanup

* Delete SearchForm

* Update search.js

* Styling fix

* Preview version updates

* Version fixes

* Preview display

* Cleanup

* m

* track current tab in store, split results

* put tab in url and load correct tab if present

* search instead of tab in url

* move out common component

* rename to SearchAccordion

* render search results stuff

* css cleanup

* Delete SearchSchools.jsx

* move to containers

* Update SearchResults.jsx

* Update SearchResults.jsx

* remove map display from 23686

* Update SearchResults.jsx

* Update SearchResults.jsx

* results box

* styling location cards

* clean up search result cards for location search

* max number to letter conversion handle any number

* move to helpers

* center map on search lat/long

* raidus junk

* cleanup

* Update constants.js

* bounding box tweaks

* Update SearchResults.jsx

* succeeded

* map markers are on the page

* Update constants.js

* markers

* Update SearchResults.jsx

* Update SearchResults.jsx

* pre-merge setup

* fixed issues and changed how bounding box after search is determined so as to work with use my current location

* map display for results using magic

* clean making map show results

* AC met

* Update SearchResults.jsx

* Update SearchResults.jsx

* Update _gi-search-location.scss

* on click map markers go gray

* Update LandingPage.jsx

* Update SearchResultCard.jsx

* kick jenkins

* fix scrolling issue

* Update Dockerfile

* Update Dockerfile

* i doubt it fixes the issue

* cleanup

* disable all tests in sandbox

* revert test skipping

* mapbogl css import

* change import order

* tleunen/eslint-import-resolver-babel-module#34 (comment)

* Revert "tleunen/eslint-import-resolver-babel-module#34 (comment)"

This reverts commit 5b6ff62.

* https://stackoverflow.com/a/49523565/1669481

* revert

* Delete LandingPage.unit.spec.jsx

Co-authored-by: Devin McCurdy <mccurdy_devin@bah.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants