-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Set babel inherit in the cli #782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Could you explain a case where it's not possible? |
A monorepo where I have multiple packages and the Or I'm in a JavaScript environment which abstracts away node (like Meteor). |
@sindresorhus maybe we can support |
@calebmer - you still have a root If you do, just put a common ava config in there.
|
Yeah, that would work, but what about a Meteor-like situation? |
We don't support browser testing yet. You usually still have a |
My feeling on options via I haven't seen a use case yet where someone is arguing to change their babel config between test runs. Even if that was what they wanted, it would probably be best to use babels I think this should be closed. |
I am running into a similar issue. The company I am consulting is running in-house NPM server, which restricts package.json (that is being published) to specific properties. I would like there to be either an |
@gajus does it reject the |
The former: attempt to publish a package with unknown fields will result in HTTP status 400. |
What NPM server is doing that? |
Again: in house and probably totally not compliant with the specs (not that such spec exists in the first place).
|
In #520 @jamestalmage said in regards to an
I think @gajus’s situation qualifies as “legitimately preventing” things getting done. |
Having a npm server that throws |
It's certainly closer to a legitimate need, but if it's in house no implementation of npm, just fix your implementation. |
AVA adheres to the official npm. We shouldn't have to adapt to every weird edge-case of unofficial solutions. It's a very common pattern to have config just in package.json. I'm not very interested in complicating the purity of that. |
There is no such thing as the official NPM (there is no spec for what the API, there is no spec defining the structure of the package.json [apart from the supported properties]).
Uh, really? I have not needed to use it once. Furthermore, this limits code portability. It is easy to copy .eslintrc/ .babelrc from one directory to another. It is not so much obvious to copy some arbitrary properties from package.json. |
By that I mean, what works with official npm is what we'll follow. |
Not listening to what community wants and driving the project solely by ones personal preferences will simple result in ava-io... Not that I care. We stopped using ava for this and several other reasons. Just chipping in to the discussion. |
@gajus We always consider user's needs, but you're just one user with a very edge-casy need. If we adapted to every edge-case, AVA would be bloated and hard to use. Creating great simple products requires saying no to thousand things.
I would appreciate if you would elaborate on what other things stopped you from using AVA :) |
I agree that feature creep is a thing. I disagree that wanting to have a separate config file is an edge-case. There are multiple reasons for wanting to have a separate config file:
For these reasons, I would want ava to accept configuration only through I agree that these reasons are opinionated and have little practical impact.
No business case. Our current test suits work. I have suggested ava as an improvement to our development, CI flow. My main argument was that it will enforce atomic tests and parallelisation will reduce the waiting time in day to day development. Note, when I am talking about "our", I am referring to the current company I am consulting. I am already using ava myself in open source and other personal projects. |
But this isn't one user's edge-casy need, a couple of issues have been opened asking for a better way to define configuration. Whether that be in the CLI (as this issue requests) or in an Creating great products does require saying no to some things, but also listening to users to discover the things you should say yes to. See #637, #520, and #782. |
None of those issues contains a problem which is preventing users from getting things done (which makes this one an edge-case) and they are both answered why we're not having a
Users preference is not an actual need. Unless |
This is actually the first time EVER I add config for a package to the package.json file. In all our repos there is a clear conventions that if anything needs config there is a file for it. .eslintrc, .babelrc, .jscsrc, web.config, cosmic.config, webpack.config, rollup.config and the list goes on... It is really good as most of these are shared or used as templates... We have few repos with configs only. On the other hand the package.json file in each project is strictly for dependencies... We are not even publishing most of the packages... For us the package.json is npm related... Even tho the tools are installed with npm (some git) they are not related or npm should not be a requirement for using them... Most used packages encourage you to use config files (eslint, babel, rollup...) Enforcing limited config usage sounds geared towards simple, small projects. And that is ok if that is the goal. I'd really like .avarc - Just my 5c |
That's also a point for not having one. I feel like all those dotfiles will only pollute your project. |
and having one giant package.json that includes config of arbitrary software is Okay? I come from a different planet. |
I didn't say it needed to be giant. I guess I don't use as many tools (or as much configuration) as you are. If I compile using I respect that you're using other tools and it's fine if there are |
At this stage I'm not convinced we need CLI flags to control AVA's usage of Babel. That's not to say this can't be improved or that AVA shouldn't integrate better with Babel improvements though. We're always open to suggestions there. We won't add CLI flags to work around configuration issues. We're yet to be convinced we truly need support for non- |
Could
--babel-inherit
or a similar flag be added to the command line? In my project I cannot depend on any fields being present in apackage.json
, so"ava": { "babel": "inherit" }
is a no go and I do everything from the command line. At the same time I need my tests to use a custom babel configuration defined in a.babelrc
file.The text was updated successfully, but these errors were encountered: