Skip to content

Commit dba60b3

Browse files
authored
chore: migrate from ts-ignore to ts-expect-error (#2103)
1 parent 9c8768f commit dba60b3

File tree

6 files changed

+72
-72
lines changed

6 files changed

+72
-72
lines changed

lib/xast.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const visitSkip = Symbol();
4444
export const visit = (node, visitor, parentNode) => {
4545
const callbacks = visitor[node.type];
4646
if (callbacks && callbacks.enter) {
47-
// @ts-ignore hard to infer
47+
// @ts-expect-error hard to infer
4848
const symbol = callbacks.enter(node, parentNode);
4949
if (symbol === visitSkip) {
5050
return;
@@ -66,7 +66,7 @@ export const visit = (node, visitor, parentNode) => {
6666
}
6767
}
6868
if (callbacks && callbacks.exit) {
69-
// @ts-ignore hard to infer
69+
// @ts-expect-error hard to infer
7070
callbacks.exit(node, parentNode);
7171
}
7272
};

plugins/_path.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ var prevCtrlPoint;
1616
* @type {(path: XastElement) => PathDataItem[]}
1717
*/
1818
export const path2js = (path) => {
19-
// @ts-ignore legacy
19+
// @ts-expect-error legacy
2020
if (path.pathJS) return path.pathJS;
2121
/**
2222
* @type {PathDataItem[]}
@@ -30,7 +30,7 @@ export const path2js = (path) => {
3030
if (pathData.length && pathData[0].command == 'm') {
3131
pathData[0].command = 'M';
3232
}
33-
// @ts-ignore legacy
33+
// @ts-expect-error legacy
3434
path.pathJS = pathData;
3535
return pathData;
3636
};
@@ -179,7 +179,7 @@ const convertRelativeToAbsolute = (data) => {
179179
* @type {(path: XastElement, data: PathDataItem[], params: Js2PathParams) => void}
180180
*/
181181
export const js2path = function (path, data, params) {
182-
// @ts-ignore legacy
182+
// @ts-expect-error legacy
183183
path.pathJS = data;
184184

185185
const pathData = [];
@@ -565,7 +565,7 @@ function gatherPoints(pathData) {
565565
case 'A':
566566
if (basePoint != null) {
567567
// Convert the arc to Bézier curves and use the same approximation
568-
// @ts-ignore no idea what's going on here
568+
// @ts-expect-error no idea what's going on here
569569
var curves = a2c.apply(0, basePoint.concat(data));
570570
for (
571571
var cData;

plugins/addAttributesToSVGElement.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,14 @@ export const fn = (root, params) => {
6060
for (const attribute of attributes) {
6161
if (typeof attribute === 'string') {
6262
if (node.attributes[attribute] == null) {
63-
// @ts-ignore disallow explicit nullable attribute value
63+
// @ts-expect-error disallow explicit nullable attribute value
6464
node.attributes[attribute] = undefined;
6565
}
6666
}
6767
if (typeof attribute === 'object') {
6868
for (const key of Object.keys(attribute)) {
6969
if (node.attributes[key] == null) {
70-
// @ts-ignore disallow explicit nullable attribute value
70+
// @ts-expect-error disallow explicit nullable attribute value
7171
node.attributes[key] = attribute[key];
7272
}
7373
}

plugins/cleanupEnableBackground.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export const fn = (root) => {
111111
enableBackgroundDeclaration
112112
) {
113113
const styleValue = csstree.generate(
114-
// @ts-ignore
114+
// @ts-expect-error
115115
enableBackgroundDeclaration.data.value,
116116
);
117117
const styleCleaned = cleanupValue(
@@ -122,7 +122,7 @@ export const fn = (root) => {
122122
);
123123

124124
if (styleCleaned) {
125-
// @ts-ignore
125+
// @ts-expect-error
126126
enableBackgroundDeclaration.data.value = {
127127
type: 'Raw',
128128
value: styleCleaned,

0 commit comments

Comments
 (0)