Comparing version 5.2.1 to 5.3.0
@@ -51,5 +51,6 @@ // eslint-disable-next-line @typescript-eslint/ban-ts-comment, @typescript-eslint/prefer-ts-expect-error | ||
VFileReporterSettings, | ||
VFileReporter | ||
VFileReporter, | ||
Map | ||
} from './lib/index.js' | ||
export {VFile} from './lib/index.js' |
@@ -28,3 +28,3 @@ export class VFile { | ||
* List of messages associated with the file. | ||
* @type {Array.<VFileMessage>} | ||
* @type {Array<VFileMessage>} | ||
*/ | ||
@@ -34,3 +34,3 @@ messages: Array<VFileMessage> | ||
* List of file paths the file moved between. | ||
* @type {Array.<string>} | ||
* @type {Array<string>} | ||
*/ | ||
@@ -67,5 +67,5 @@ history: Array<string> | ||
* This should be a `RawSourceMap` type from the `source-map` module. | ||
* @type {unknown} | ||
* @type {Map|undefined} | ||
*/ | ||
map: unknown | ||
map: Map | undefined | ||
/** | ||
@@ -225,2 +225,15 @@ * Set full path (`~/index.min.js`). | ||
/** | ||
* Raw source map, see: | ||
* <https://github.com/mozilla/source-map/blob/58819f0/source-map.d.ts#L15-L23>. | ||
*/ | ||
export type Map = { | ||
version: number | ||
sources: Array<string> | ||
names: Array<string> | ||
sourceRoot?: string | undefined | ||
sourcesContent?: Array<string> | undefined | ||
mappings: string | ||
file: string | ||
} | ||
/** | ||
* Configuration: a bunch of keys that will be shallow copied over to the new | ||
@@ -232,13 +245,7 @@ * file. | ||
} & VFileCoreOptions | ||
export type VFileReporterSettings = { | ||
[x: string]: unknown | ||
} | ||
export type VFileReporter = < | ||
T = { | ||
[x: string]: unknown | ||
} | ||
>( | ||
files: VFile[], | ||
export type VFileReporterSettings = Record<string, unknown> | ||
export type VFileReporter = <T = VFileReporterSettings>( | ||
files: Array<VFile>, | ||
options: T | ||
) => string | ||
import {VFileMessage} from 'vfile-message' |
@@ -22,3 +22,3 @@ /** | ||
* @property {string} [cwd] | ||
* @property {Array.<string>} [history] | ||
* @property {Array<string>} [history] | ||
* @property {string|URL} [path] | ||
@@ -31,2 +31,13 @@ * @property {string} [basename] | ||
* | ||
* @typedef Map | ||
* Raw source map, see: | ||
* <https://github.com/mozilla/source-map/blob/58819f0/source-map.d.ts#L15-L23>. | ||
* @property {number} version | ||
* @property {Array<string>} sources | ||
* @property {Array<string>} names | ||
* @property {string|undefined} [sourceRoot] | ||
* @property {Array<string>|undefined} [sourcesContent] | ||
* @property {string} mappings | ||
* @property {string} file | ||
* | ||
* @typedef {{[key: string]: unknown} & VFileCoreOptions} VFileOptions | ||
@@ -36,4 +47,4 @@ * Configuration: a bunch of keys that will be shallow copied over to the new | ||
* | ||
* @typedef {Object.<string, unknown>} VFileReporterSettings | ||
* @typedef {<T = VFileReporterSettings>(files: VFile[], options: T) => string} VFileReporter | ||
* @typedef {Record<string, unknown>} VFileReporterSettings | ||
* @typedef {<T = VFileReporterSettings>(files: Array<VFile>, options: T) => string} VFileReporter | ||
*/ | ||
@@ -95,3 +106,3 @@ | ||
* List of messages associated with the file. | ||
* @type {Array.<VFileMessage>} | ||
* @type {Array<VFileMessage>} | ||
*/ | ||
@@ -102,3 +113,3 @@ this.messages = [] | ||
* List of file paths the file moved between. | ||
* @type {Array.<string>} | ||
* @type {Array<string>} | ||
*/ | ||
@@ -144,3 +155,3 @@ this.history = [] | ||
* This should be a `RawSourceMap` type from the `source-map` module. | ||
* @type {unknown} | ||
* @type {Map|undefined} | ||
*/ | ||
@@ -147,0 +158,0 @@ this.map |
@@ -25,3 +25,3 @@ export namespace path { | ||
/** | ||
* @param {Array.<string>} segments | ||
* @param {Array<string>} segments | ||
* @returns {string} | ||
@@ -28,0 +28,0 @@ */ |
@@ -249,3 +249,3 @@ // A derivative work based on: | ||
/** | ||
* @param {Array.<string>} segments | ||
* @param {Array<string>} segments | ||
* @returns {string} | ||
@@ -252,0 +252,0 @@ */ |
{ | ||
"name": "vfile", | ||
"version": "5.2.1", | ||
"version": "5.3.0", | ||
"description": "Virtual file format for text processing", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -177,7 +177,7 @@ <h1> | ||
`Array.<string>` — List of file-paths the file moved between. | ||
`Array<string>` — List of file-paths the file moved between. | ||
### `vfile.messages` | ||
[`Array.<VMessage>`][message] — List of messages associated with the file. | ||
[`Array<VMessage>`][message] — List of messages associated with the file. | ||
@@ -268,3 +268,3 @@ ### `vfile.data` | ||
The following list of projects show linting results for given virtual files. | ||
Reporters *must* accept `Array.<VFile>` as their first argument, and return | ||
Reporters *must* accept `Array<VFile>` as their first argument, and return | ||
`string`. | ||
@@ -271,0 +271,0 @@ Reporters *may* accept other values too, in which case it’s suggested to stick |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
54219
1176