drive by lint

pull/8514/head
Simon H 3 years ago committed by GitHub
parent 90cbcef41f
commit ca280a6c15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -9,19 +9,14 @@ const href: Action<HTMLAnchorElement> = (node) => {
}; };
href; href;
const required: Action<HTMLElement, boolean> = (node, param) => { const required: Action<HTMLElement, boolean> = (_node, _param) => {};
node;
param;
};
required(null as any, true); required(null as any, true);
// @ts-expect-error (only in strict mode) boolean missing // @ts-expect-error (only in strict mode) boolean missing
required(null as any); required(null as any);
// @ts-expect-error no boolean // @ts-expect-error no boolean
required(null as any, 'string'); required(null as any, 'string');
const required1: Action<HTMLElement, boolean> = (node, param) => { const required1: Action<HTMLElement, boolean> = (_node, _param) => {
node;
param;
return { return {
update: (p) => p === true, update: (p) => p === true,
destroy: () => {} destroy: () => {}
@ -29,14 +24,10 @@ const required1: Action<HTMLElement, boolean> = (node, param) => {
}; };
required1; required1;
const required2: Action<HTMLElement, boolean> = (node) => { const required2: Action<HTMLElement, boolean> = (_node) => {};
node;
};
required2; required2;
const required3: Action<HTMLElement, boolean> = (node, param) => { const required3: Action<HTMLElement, boolean> = (_node, _param) => {
node;
param;
return { return {
// @ts-expect-error comparison always resolves to false // @ts-expect-error comparison always resolves to false
update: (p) => p === 'd', update: (p) => p === 'd',
@ -45,18 +36,13 @@ const required3: Action<HTMLElement, boolean> = (node, param) => {
}; };
required3; required3;
const optional: Action<HTMLElement, boolean | undefined> = (node, param?) => { const optional: Action<HTMLElement, boolean | undefined> = (_node, _param?) => {};
node;
param;
};
optional(null as any, true); optional(null as any, true);
optional(null as any); optional(null as any);
// @ts-expect-error no boolean // @ts-expect-error no boolean
optional(null as any, 'string'); optional(null as any, 'string');
const optional1: Action<HTMLElement, boolean | undefined> = (node, param?) => { const optional1: Action<HTMLElement, boolean | undefined> = (_node, _param?) => {
node;
param;
return { return {
update: (p) => p === true, update: (p) => p === true,
destroy: () => {} destroy: () => {}
@ -64,20 +50,13 @@ const optional1: Action<HTMLElement, boolean | undefined> = (node, param?) => {
}; };
optional1; optional1;
const optional2: Action<HTMLElement, boolean | undefined> = (node) => { const optional2: Action<HTMLElement, boolean | undefined> = (_node) => {};
node;
};
optional2; optional2;
const optional3: Action<HTMLElement, boolean | undefined> = (node, param) => { const optional3: Action<HTMLElement, boolean | undefined> = (_node, _param) => {};
node;
param;
};
optional3; optional3;
const optional4: Action<HTMLElement, boolean | undefined> = (node, param?) => { const optional4: Action<HTMLElement, boolean | undefined> = (_node, _param?) => {
node;
param;
return { return {
// @ts-expect-error comparison always resolves to false // @ts-expect-error comparison always resolves to false
update: (p) => p === 'd', update: (p) => p === 'd',
@ -86,17 +65,14 @@ const optional4: Action<HTMLElement, boolean | undefined> = (node, param?) => {
}; };
optional4; optional4;
const no: Action<HTMLElement, never> = (node) => { const no: Action<HTMLElement, never> = (_node) => {};
node;
};
// @ts-expect-error second param // @ts-expect-error second param
no(null as any, true); no(null as any, true);
no(null as any); no(null as any);
// @ts-expect-error second param // @ts-expect-error second param
no(null as any, 'string'); no(null as any, 'string');
const no1: Action<HTMLElement, never> = (node) => { const no1: Action<HTMLElement, never> = (_node) => {
node;
return { return {
destroy: () => {} destroy: () => {}
}; };
@ -104,15 +80,15 @@ const no1: Action<HTMLElement, never> = (node) => {
no1; no1;
// @ts-expect-error param given // @ts-expect-error param given
const no2: Action<HTMLElement, never> = (node, param?) => {}; const no2: Action<HTMLElement, never> = (_node, _param?) => {};
no2; no2;
// @ts-expect-error param given // @ts-expect-error param given
const no3: Action<HTMLElement, never> = (node, param) => {}; const no3: Action<HTMLElement, never> = (_node, _param) => {};
no3; no3;
// @ts-expect-error update method given // @ts-expect-error update method given
const no4: Action<HTMLElement, never> = (node) => { const no4: Action<HTMLElement, never> = (_node) => {
return { return {
update: () => {}, update: () => {},
destroy: () => {} destroy: () => {}

Loading…
Cancel
Save