Skip to content
New issue

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

fix(markdownlint): disable MD030 rule conflicting with Prettier #202

Merged
merged 1 commit into from
Jun 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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