-
Notifications
You must be signed in to change notification settings - Fork 45
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
feat: add command line option for choosing between double and single quotes #39
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of small tweaks but overall looks good. Useful feature and thorough pull request. Thanks for contributing 👍
.version() | ||
.alias("v", "version") | ||
.default("v", false) | ||
|
||
.boolean("V") | ||
.alias("V", "verbose") | ||
.describe("V", "Display additional logging information") | ||
.default("D", false); | ||
.default("V", false); | ||
} | ||
|
||
export function getOptions(): Options { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seeing as the quote character is going to be constant throughout execution of the program, you can evaluate it once here and add it to the options object rather than resolving it each time using getQuoteCharacter
.
src/builders/flat.ts
Outdated
|
||
import {buildImportPath} from "../builder"; | ||
|
||
export function buildFlatBarrel(directory: Directory, modules: Location[], options: Options): string { | ||
const quoteChar = getQuoteCharacter(options); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would prefer quoteCharacter
package.json
Outdated
@@ -1,6 +1,6 @@ | |||
{ | |||
"name": "barrelsby", | |||
"version": "0.0.4", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't need to resolve this (as I can do it when I release) but there is already a v0.0.5
I released a beta for #34 so this will be released as v0.0.6
.
Thank you for reviewing so quickly! I refactored so that we're using a |
Thanks 👍 Published to NPM as version 0.0.7 |
Some people prefer single quotes for their imports. This PR add the -q option to use single quotes in the generated imports/exports.