Skip to content

Commit

Permalink
Update xo
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Aug 3, 2021
1 parent 6d5f78e commit 727b687
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"typescript": "^4.0.0",
"unified": "^10.0.0",
"unist-util-remove-position": "^4.0.0",
"xo": "^0.37.0"
"xo": "^0.39.0"
},
"scripts": {
"postinstall": "lerna bootstrap --no-ci",
Expand Down
7 changes: 5 additions & 2 deletions packages/remark-stringify/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,11 @@ test('remarkStringify', (t) => {
['capitalized image references - collapsed', '![Bravo][]'],
['capitalized image references - shortcut', '![Bravo]']
]
let index = -1

while (++index < tests.length) {
const test = tests[index]

tests.forEach((test) => {
t.equal(
unified()
.use(remarkParse)
Expand All @@ -321,7 +324,7 @@ test('remarkStringify', (t) => {
test[1] + '\n\n[bravo]: #\n',
test[0]
)
})
}

t.end()
})
Expand Down
14 changes: 10 additions & 4 deletions script/regenerate-fixtures.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ import {fixtures} from '../test/fixtures/index.js'

const base = path.join('test', 'fixtures', 'tree')
const generated = []
let index = -1

fixtures.forEach((fixture) => {
while (++index < fixtures.length) {
const fixture = fixtures[index]
const stem = path.basename(fixture.name, path.extname(fixture.name))
const input = fixture.input
let result
Expand All @@ -24,10 +26,14 @@ fixtures.forEach((fixture) => {
)

generated.push(stem + '.json')
})
}

fs.readdirSync(base).forEach((basename) => {
const files = fs.readdirSync(base)
index = -1

while (++index < files.length) {
const basename = files[index]
if (basename.charAt(0) !== '.' && !generated.includes(basename)) {
console.warn('Unused fixture: `%s`', basename)
}
})
}

0 comments on commit 727b687

Please sign in to comment.