We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Currently, textlint --format unavailable-formatter throw error.
textlint --format unavailable-formatter
$ textlint -f unavailable-formatter README.md ✖ Error formatter is not a function ✖ Stack trace TypeError: formatter is not a function
But, this error is not meaningful. We should check the formatter is available before liting.
From #148
textlint has two type formatter. One is linter formater, Anther is fixer formatter
This difference cause unexepected error in following scenario.
First, You run lint a text.
texlint -f pretty-error README.md
Then, the lint result has error message.
Second, You want to fix this error, and run textlint --fix.
textlint --fix
texlint --fix -f pretty-error README.md
texlint --fix -f pretty-error throw error! Because, fixer formater not have pretty-error formatter.
texlint --fix -f pretty-error
pretty-error
We want to add warning for this scenario.
resolveFormatter(name: string): string | null
cli.execute
textlint/packages/textlint/src/cli.ts
Line 65 in fa68399
linterFormatter.resolveFormatter()
null
--fix
fixerFormatter.resolveFormatter()
getFormatterList
The text was updated successfully, but these errors were encountered:
--format compats
No branches or pull requests
Currently,
textlint --format unavailable-formatter
throw error.But, this error is not meaningful.
We should check the formatter is available before liting.
Motivation
From #148
textlint has two type formatter.
One is linter formater, Anther is fixer formatter
This difference cause unexepected error in following scenario.
First, You run lint a text.
Then, the lint result has error message.
Second, You want to fix this error, and run
textlint --fix
.texlint --fix -f pretty-error
throw error!Because, fixer formater not have
pretty-error
formatter.We want to add warning for this scenario.
Tasks
resolveFormatter(name: string): string | null
to formatter modulescli.execute
textlint/packages/textlint/src/cli.ts
Line 65 in fa68399
Check logic
linterFormatter.resolveFormatter()
returnnull
, show warning and exit 1.--fix
) modefixerFormatter.resolveFormatter()
returnnull
, show warning and exit 1.Related
getFormatterList
function formater: AddgetFormatterList
function #399The text was updated successfully, but these errors were encountered: