Skip to content

Commit

Permalink
Update dev-dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Dec 27, 2020
1 parent e9e3b3a commit cf97d0d
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 29 deletions.
2 changes: 1 addition & 1 deletion lib/file-set-pipeline/stdin.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function stdin(context, settings, next) {
var streamIn = settings.streamIn
var error

if (settings.files && settings.files.length !== 0) {
if (settings.files && settings.files.length > 0) {
debug('Ignoring `streamIn`')

if (settings.filePath) {
Expand Down
2 changes: 1 addition & 1 deletion lib/finder.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ function search(input, options, next) {
if (
nested &&
!dir &&
extensions.length !== 0 &&
extensions.length > 0 &&
extensions.indexOf(ext) === -1
) {
return one(null, [])
Expand Down
15 changes: 7 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,25 +45,25 @@
"vfile-statistics": "^1.1.0"
},
"devDependencies": {
"@types/node": "^13.0.0",
"@types/node": "^14.0.0",
"@types/unist": "^2.0.0",
"dtslint": "^3.0.0",
"dtslint": "^4.0.0",
"nyc": "^15.0.0",
"prettier": "^2.0.0",
"remark": "^12.0.0",
"remark-cli": "^8.0.0",
"remark-preset-wooorm": "^7.0.0",
"remark": "^13.0.0",
"remark-cli": "^9.0.0",
"remark-preset-wooorm": "^8.0.0",
"remark-toc": "^7.0.0",
"strip-ansi": "^6.0.0",
"tape": "^5.0.0",
"unified": "^9.0.0",
"vfile": "^4.0.0",
"vfile-reporter-json": "^2.0.0",
"vfile-reporter-pretty": "^5.0.0",
"xo": "^0.32.0"
"xo": "^0.36.0"
},
"scripts": {
"format": "remark . -qfo && prettier . --write && xo --fix",
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",
"test-api": "node test",
"test-coverage": "nyc --reporter lcov tape test/index.js",
"test-types": "dtslint types",
Expand Down Expand Up @@ -106,7 +106,6 @@
"unicorn/no-fn-reference-in-iterator": "off",
"unicorn/prefer-optional-catch-binding": "off",
"unicorn/prefer-includes": "off",
"unicorn/string-content": "off",
"complexity": "off",
"guard-for-in": "off"
}
Expand Down
4 changes: 2 additions & 2 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,15 +246,15 @@ declare namespace unifiedEngine {
* @returns If a promise is returned, the function is asynchronous, and must be resolved (with nothing) or rejected
*/
interface Completer {
(fileSet: FileSet, next?: CompleterNext): Error | Promise<void>

/**
* Plugins specified through various mechanisms are attached to a new processor for each file.
* If a completer is used multiple times, it is invoked multiple times as well.
* To prevent completers from attaching multiple times, specify a `pluginId`.
* This will ensure only one completer per `pluginId` is added.
*/
pluginId?: string

(fileSet: FileSet, next?: CompleterNext): Error | Promise<void>
}

/**
Expand Down
2 changes: 1 addition & 1 deletion types/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"strict": true,
"baseUrl": ".",
"paths": {
"unified-engine": ["index.d.ts"]
"unified-engine": ["."]
}
}
}
37 changes: 21 additions & 16 deletions types/unified-engine-tests.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable-next-line import/no-extraneous-dependencies */
import * as engine from 'unified-engine'
import * as remark from 'remark'
import {VFile} from 'vfile'
Expand All @@ -8,15 +9,15 @@ engine(
{
processor: remark()
},
() => {}
done
)

engine(
{
processor: remark(),
settings: {gfm: true}
settings: {strong: '*'}
},
() => {}
done
)

engine(
Expand All @@ -25,7 +26,7 @@ engine(
// $ExpectError
settings: {notARealSetting: true}
},
() => {}
done
)

interface CustomReporterOptions {
Expand All @@ -39,7 +40,7 @@ engine(
processor: remark(),
reporter: customReporter
},
() => {}
done
)

engine(
Expand All @@ -48,7 +49,7 @@ engine(
reporter: customReporter,
reporterOptions: {example: true}
},
() => {}
done
)

engine(
Expand All @@ -58,49 +59,49 @@ engine(
// $ExpectError
reporterOptions: {notARealSetting: true}
},
() => {}
done
)

engine(
{
processor: remark(),
reporter: 'vfile-reporter-pretty',
// settings cannot be inferred
// Settings cannot be inferred
reporterOptions: {notARealSetting: true}
},
() => {}
done
)

engine(
{
processor: remark(),
output: true
},
() => {}
done
)

engine(
{
processor: remark(),
output: false
},
() => {}
done
)

engine(
{
processor: remark(),
output: '.'
},
() => {}
done
)

engine(
{
processor: remark(),
configTransform: (content: unknown) => ({settings: {commonmark: true}})
},
() => {}
done
)

engine(
Expand All @@ -124,7 +125,7 @@ engine(
packageField: 'exampleConfig',
detectConfig: true,
rcPath: '.',
settings: {gfm: true},
settings: {strong: '*'},
ignoreName: '.exampleignore',
ignorePatterns: ['.hidden'],
silentlyIgnore: false,
Expand All @@ -138,7 +139,7 @@ engine(
quiet: false,
frail: false
},
() => {}
done
)

engine(
Expand All @@ -147,11 +148,15 @@ engine(
},
(err, status, context) => {
if (err || status === 1) {
console.error('failed with error ', err)
console.error('failed with error', err)
return
}

context.files.forEach((file) => console.log(file.name))
context.fileset.valueOf().forEach((file) => console.log(file.name))
}
)

function done() {
// Empty.
}

0 comments on commit cf97d0d

Please sign in to comment.