-
-
Notifications
You must be signed in to change notification settings - Fork 28
feat: update ui #202
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
Merged
+100
−22
Merged
feat: update ui #202
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
ed9946d
fix: remove double blank lines when not use eslintrc style
hyperz111 4eddef4
Merge branch 'eslint:main' into main
hyperz111 570f583
Merge branch 'eslint:main' into main
hyperz111 1641ad4
Merge branch 'eslint:main' into main
hyperz111 763280a
Merge branch 'eslint:main' into main
hyperz111 f3f1aa4
add ansi-colors
hyperz111 3140a21
add style for questions
hyperz111 c186f70
add style for logg util
hyperz111 21525d4
change error color back to magenta
hyperz111 40d05e3
update console
hyperz111 da3ab41
some changes
hyperz111 bb48323
some changes
hyperz111 5c1edf1
change jsdoc type
hyperz111 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,44 @@ | |
* @author 唯然<[email protected]> | ||
*/ | ||
|
||
export const langQuestions = [{ | ||
/** | ||
* @typedef {Record<string, any>} PlainObject | ||
*/ | ||
|
||
// ------------------------------------------------------------------------------ | ||
// Imports | ||
// ------------------------------------------------------------------------------ | ||
|
||
import colors from "ansi-colors"; | ||
|
||
// ------------------------------------------------------------------------------ | ||
// Helpers | ||
// ------------------------------------------------------------------------------ | ||
|
||
/** | ||
* Set questions prompt style options in here. | ||
* @param {PlainObject[]} questionsPromptArray Array of questions prompt. | ||
* @returns {PlainObject[]} Questions prompt with style options. | ||
*/ | ||
function setQuestionsPromptStyle(questionsPromptArray) { | ||
return questionsPromptArray.map(opts => ({ | ||
...opts, | ||
symbols: { | ||
|
||
// For option symbol in select and multiselect | ||
indicator: { | ||
on: colors.cyan(colors.symbols.radioOn), | ||
off: colors.gray(colors.symbols.radioOff) | ||
} | ||
} | ||
})); | ||
} | ||
|
||
// ------------------------------------------------------------------------------ | ||
// Exports | ||
// ------------------------------------------------------------------------------ | ||
|
||
export const langQuestions = setQuestionsPromptStyle([{ | ||
type: "multiselect", | ||
name: "languages", | ||
message: "What do you want to lint?", | ||
|
@@ -25,9 +62,9 @@ export const langQuestions = [{ | |
{ message: "To check syntax only", name: "syntax" }, | ||
{ message: "To check syntax and find problems", name: "problems" } | ||
] | ||
}]; | ||
}]); | ||
|
||
export const jsQuestions = [ | ||
export const jsQuestions = setQuestionsPromptStyle([ | ||
{ | ||
type: "select", | ||
name: "moduleType", | ||
|
@@ -82,9 +119,9 @@ export const jsQuestions = [ | |
return !this.state.answers.useTs; | ||
} | ||
} | ||
]; | ||
]); | ||
|
||
export const mdQuestions = [{ | ||
export const mdQuestions = setQuestionsPromptStyle([{ | ||
type: "select", | ||
name: "mdType", | ||
message: "What flavor of Markdown do you want to lint?", | ||
|
@@ -93,9 +130,9 @@ export const mdQuestions = [{ | |
{ message: "CommonMark", name: "commonmark" }, | ||
{ message: "GitHub Flavored Markdown", name: "gfm" } | ||
] | ||
}]; | ||
}]); | ||
|
||
export const installationQuestions = [ | ||
export const installationQuestions = setQuestionsPromptStyle([ | ||
{ | ||
type: "toggle", | ||
name: "executeInstallation", | ||
|
@@ -113,13 +150,13 @@ export const installationQuestions = [ | |
return this.state.answers.executeInstallation === false; | ||
} | ||
} | ||
]; | ||
]); | ||
|
||
export const addJitiQuestion = { | ||
export const addJitiQuestion = setQuestionsPromptStyle([{ | ||
type: "toggle", | ||
name: "addJiti", | ||
message: "Would you like to add Jiti as a devDependency?", | ||
disabled: "No", | ||
enabled: "Yes", | ||
initial: 1 | ||
}; | ||
}]); | ||
aladdin-add marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.