Skip to content

Commit

Permalink
Refactor code-style
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Aug 9, 2021
1 parent 3c76949 commit 1b51b19
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 13 deletions.
3 changes: 2 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
* @typedef {import('./options.js').Options} Options
*/

import stream from 'stream'
import process from 'node:process'
import stream from 'node:stream'
import chalk from 'chalk'
import chokidar from 'chokidar'
import {engine} from 'unified-engine'
Expand Down
7 changes: 2 additions & 5 deletions lib/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,7 @@ function reporter(value) {
/**
* @returns {[string, Record<string, unknown>|undefined]}
*/
(value) => {
return [value[0], value[1] ? parseConfig(value[1], {}) : undefined]
}
(value) => [value[0], value[1] ? parseConfig(value[1], {}) : undefined]
)

return all[all.length - 1] || []
Expand Down Expand Up @@ -351,8 +349,7 @@ function normalize(value) {
*/
function flatten(values) {
// @ts-expect-error: TS is wrong.
// eslint-disable-next-line prefer-spread
return [].concat.apply([], values)
return values.flat()
}

/**
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"typescript": "^4.0.0",
"unified": "^10.0.0",
"vfile-reporter-json": "^3.0.0",
"xo": "^0.39.0"
"xo": "^0.44.0"
},
"scripts": {
"build": "rimraf \"lib/**/*.d.ts\" \"test/**/*.d.ts\" && tsc && type-coverage",
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/example/cli.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env node
import path from 'path'
import path from 'node:path'
import {args} from '../../../index.js'
import {processor} from '../processor.js'
import {config} from '../config.js'
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/plugins/cli.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env node
import path from 'path'
import path from 'node:path'
import {args} from '../../../index.js'
import {processor} from '../processor.js'
import {config} from '../config.js'
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/settings/cli.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env node
import path from 'path'
import path from 'node:path'
import {args} from '../../../index.js'
import {processor} from '../processor.js'
import {config} from '../config.js'
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/uncaught-errors/cli.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env node
import path from 'path'
import path from 'node:path'
import {args} from '../../../index.js'
import {processor} from '../processor.js'
import {config} from '../config.js'
Expand Down
5 changes: 3 additions & 2 deletions test/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import fs from 'fs'
import path from 'path'
import fs from 'node:fs'
import path from 'node:path'
import process from 'node:process'
import execa from 'execa'
import {bail} from 'bail'
import test from 'tape'
Expand Down

0 comments on commit 1b51b19

Please sign in to comment.