mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
Add missing lineNumber property to FixInfo type (fixes #405).
This commit is contained in:
parent
cebde8f9f6
commit
02240fac98
3 changed files with 13 additions and 7 deletions
|
@ -34,13 +34,14 @@ function assertLintResults(results: markdownlint.LintResults) {
|
||||||
assert.equal(results["string"][0].errorDetail, null);
|
assert.equal(results["string"][0].errorDetail, null);
|
||||||
assert.equal(results["string"][0].errorContext, null);
|
assert.equal(results["string"][0].errorContext, null);
|
||||||
assert.deepEqual(results["string"][0].errorRange, [ 9, 1 ]);
|
assert.deepEqual(results["string"][0].errorRange, [ 9, 1 ]);
|
||||||
assert(!!results["string"][0].fixInfo);
|
const fixInfo = results["string"][0].fixInfo;
|
||||||
// @ts-ignore
|
assert(!!fixInfo);
|
||||||
assert.equal(results["string"][0].fixInfo.editColumn, 10);
|
if (fixInfo) {
|
||||||
// @ts-ignore
|
assert.equal(fixInfo.lineNumber, null);
|
||||||
assert(!results["string"][0].fixInfo.deleteCount);
|
assert.equal(fixInfo.editColumn, 10);
|
||||||
// @ts-ignore
|
assert(!fixInfo.deleteCount);
|
||||||
assert.equal(results["string"][0].fixInfo.insertText, "\n");
|
assert.equal(fixInfo.insertText, "\n");
|
||||||
|
}
|
||||||
assert.equal(results["../bad.md"].length, 2);
|
assert.equal(results["../bad.md"].length, 2);
|
||||||
// Deliberate assignment to unused variable validates types
|
// Deliberate assignment to unused variable validates types
|
||||||
// False-positive for js/useless-assignment-to-local
|
// False-positive for js/useless-assignment-to-local
|
||||||
|
|
4
lib/markdownlint.d.ts
vendored
4
lib/markdownlint.d.ts
vendored
|
@ -316,6 +316,10 @@ type LintError = {
|
||||||
* Fix information.
|
* Fix information.
|
||||||
*/
|
*/
|
||||||
type FixInfo = {
|
type FixInfo = {
|
||||||
|
/**
|
||||||
|
* Line number (1-based).
|
||||||
|
*/
|
||||||
|
lineNumber?: number;
|
||||||
/**
|
/**
|
||||||
* Column of the fix (1-based).
|
* Column of the fix (1-based).
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1196,6 +1196,7 @@ module.exports = markdownlint;
|
||||||
* Fix information.
|
* Fix information.
|
||||||
*
|
*
|
||||||
* @typedef {Object} FixInfo
|
* @typedef {Object} FixInfo
|
||||||
|
* @property {number} [lineNumber] Line number (1-based).
|
||||||
* @property {number} [editColumn] Column of the fix (1-based).
|
* @property {number} [editColumn] Column of the fix (1-based).
|
||||||
* @property {number} [deleteCount] Count of characters to delete.
|
* @property {number} [deleteCount] Count of characters to delete.
|
||||||
* @property {string} [insertText] Text to insert (after deleting).
|
* @property {string} [insertText] Text to insert (after deleting).
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue