From 5a544e21d74ce7aec53044fe3f9020782d353ac9 Mon Sep 17 00:00:00 2001 From: Masafumi Koba Date: Sun, 17 Jun 2018 04:53:34 +0900 Subject: [PATCH] fix(markdownlint): disable `MD030` rule conflicting with Prettier See . --- .markdownlint.json | 3 +++ lib/init.js | 1 + test/init.test.js | 32 +++++++++++--------------------- 3 files changed, 15 insertions(+), 21 deletions(-) create mode 100644 .markdownlint.json diff --git a/.markdownlint.json b/.markdownlint.json new file mode 100644 index 00000000..60cc5fb5 --- /dev/null +++ b/.markdownlint.json @@ -0,0 +1,3 @@ +{ + "MD030": false +} diff --git a/lib/init.js b/lib/init.js index d9d3b2f1..70d36136 100644 --- a/lib/init.js +++ b/lib/init.js @@ -78,6 +78,7 @@ module.exports = async function init() { await cmd.updatePackageFile() await cmd.writePackageFile('.editorconfig') await cmd.writePackageFile('.prettierignore') + await cmd.writePackageFile('.markdownlint.json') await cmd.writeTemplateFile('.eslintrc.js') await cmd.writeTemplateFile('.commitlintrc.js') } diff --git a/test/init.test.js b/test/init.test.js index 39386ce4..c96a2b57 100644 --- a/test/init.test.js +++ b/test/init.test.js @@ -63,27 +63,17 @@ test('init', t => { t.is(actual, expected) t.end() }) - - testInSandbox('write ".editorconfig"', async (t, ctx) => { - await ctx.fixture('package-normal.json') - await init() - t.ok(ctx.logMessage().includes('package.json was updated.')) - - const original = await ctx.readOrigFile('.editorconfig') - const copy = await ctx.readWorkFile('.editorconfig') - t.is(original, copy) - t.end() - }) - - testInSandbox('write ".prettierignore"', async (t, ctx) => { - await ctx.fixture('package-normal.json') - await init() - t.ok(ctx.logMessage().includes('package.json was updated.')) - - const original = await ctx.readOrigFile('.prettierignore') - const copy = await ctx.readWorkFile('.prettierignore') - t.is(original, copy) - t.end() + ;['.editorconfig', '.prettierignore', '.markdownlint.json'].forEach(file => { + testInSandbox(`write "${file}"`, async (t, ctx) => { + await ctx.fixture('package-normal.json') + await init() + t.ok(ctx.logMessage().includes('package.json was updated.')) + + const original = await ctx.readOrigFile(file) + const copy = await ctx.readWorkFile(file) + t.is(original, copy) + t.end() + }) }) testInSandbox('write ".eslintrc.js"', async (t, ctx) => {