Skip to content

Commit

Permalink
fix(markdownlint): disable MD030 rule conflicting with Prettier (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
ybiquitous committed Jun 16, 2018
1 parent 956769c commit 7878c5e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 21 deletions.
3 changes: 3 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"MD030": false
}
1 change: 1 addition & 0 deletions lib/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
Expand Down
32 changes: 11 additions & 21 deletions test/init.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 7878c5e

Please sign in to comment.