Is there a way to analyze a file and clone its config? I have been formatting my files with deno fmt
, and now I want to clone its config into Prettier because it’s a requirement in another project.
For example, analyze the following code block (or the entire file):
public command(
name: string | RegExp,
description: string,
handlerOrOptions?:
| MaybeArray<Middleware<CommandContext<C>>>
| Partial<CommandOptions>,
_options?: Partial<CommandOptions>,
) {
description = 'single quote';
const handler = isMiddleware(handlerOrOptions)
? handlerOrOptions
: undefined;
// etc etc
}
and output a .prettierc
file like
{
"SingleQuote": true,
// wrap, semicolons etc
}
eslint
{
"plugins": ["prettier"],
"rules": {
"prettier/prettier": "error",
"operator-linebreak": ["error", "before"]
}
}