From 05c6ff8129017f2a63871acf6fd4226255c4e87c Mon Sep 17 00:00:00 2001 From: matzkoh Date: Sun, 10 Sep 2023 19:14:01 +0900 Subject: [PATCH] chore: fix generate docs --- .eslint-doc-generatorrc.cjs | 15 +++++++++++++++ prettier.config.cjs | 9 +++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 .eslint-doc-generatorrc.cjs diff --git a/.eslint-doc-generatorrc.cjs b/.eslint-doc-generatorrc.cjs new file mode 100644 index 0000000..8f6b312 --- /dev/null +++ b/.eslint-doc-generatorrc.cjs @@ -0,0 +1,15 @@ +const prettier = require('prettier') + +/** @type {import('eslint-doc-generator').GenerateOptions} */ +module.exports = { + postprocess: async (content, filepath) => { + const configFile = await prettier.resolveConfigFile() + const config = require(configFile) + const resolvedConfig = await prettier.resolveConfig(filepath, config) + + return prettier.format(content, { + ...resolvedConfig, + filepath, + }) + }, +} diff --git a/prettier.config.cjs b/prettier.config.cjs index 726023a..6477b86 100644 --- a/prettier.config.cjs +++ b/prettier.config.cjs @@ -1,12 +1,17 @@ -/** @type {import('prettier').Options} */ +/** @type {import('prettier').Config} */ module.exports = { - plugins: ['prettier-plugin-packagejson'], arrowParens: 'avoid', printWidth: 100, semi: false, singleQuote: true, trailingComma: 'all', overrides: [ + { + files: 'package.json', + options: { + plugins: ['prettier-plugin-packagejson'], + }, + }, { files: '*.{md,yaml,yml}', options: {