[FeatureRequest] rename `.default` method
See original GitHub issueBrief
strictOptions
can not be trigger under require("yargs").default
Background
// x.ts
import yargs from 'yargs'
// tsc output x.js is something like
const yargs = require("yargs").default
Expected
require("yargs").default(["bar", "-a", "10"]).strictOptions().argv
// Error
Options:
--help Show help [boolean]
--version Show version number [boolean]
Unknown argument: a
Actual
require("yargs").default(["bar", "-a", "10"]).strictOptions().argv
// Error is not trigger
{
'10': undefined,
_: [],
bar: undefined,
'-a': undefined,
a: undefined,
'$0': ''
}
Workaround
// y.ts
import * as yargs from 'yargs'
// tsc output y.js is something like
var yargs = require("yargs");
Reproduce Gist
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Renaming component's default state – Adobe XD Feedback
Let us be able to rename the component's default state, so it can make more sense during the component building process.
Read more >Renaming Feature Requests to Feedback - Airfocus
If you rename feature requests to feedback and treat them alike, magic happens. It helps you focising on problems and outcomes.
Read more >Renaming the default branch from master - GitHub
Renaming existing branches You can now rename any branch, including the default branch, from the web. Renaming a branch will: Re-target any open...
Read more >Solved: Is there a way to delete "Default State"? (or repl...
Solved: I like my states to be named exactly what they are. So I've consistently ignored default state and made a "New State"...
Read more >Easily rename your Git default branch from master to main
Go to the master branch · Rename master to main locally · Get the latest commits from the server · Remove the link...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Still think might be better to rename
.default
. So, when missing"esModuleInterop": true
, error is raised instead of silent failure.@karizma @bcoe Anyway, thanks for your reply. Wish you have a nice day. 😃
@loynoir, as @karizma says you should be able to use
.defaults
, rather thandefault
, and work around your compilation issue.