Disable no-undefined ESLint lint

This commit is contained in:
MareStare 2025-02-13 19:16:18 +00:00
parent a6fee28bf8
commit 351c4cff19
5 changed files with 5 additions and 6 deletions

View file

@ -181,7 +181,7 @@ export default tsEslint.config(
'no-trailing-spaces': 2,
'no-undef-init': 2,
'no-undef': 2,
'no-undefined': 2,
'no-undefined': 0,
'no-underscore-dangle': 0,
'no-unexpected-multiline': 2,
'no-unmodified-loop-condition': 2,

View file

@ -17,7 +17,7 @@ export function parseTokens(lexicalArray: TokenList): AstMatcher {
const op2 = operandStack.pop();
const op1 = operandStack.pop();
if (typeof op1 === 'undefined' || typeof op2 === 'undefined') {
if (op1 === undefined || op2 === undefined) {
throw new ParseError('Missing operand.');
}
@ -43,7 +43,7 @@ export function parseTokens(lexicalArray: TokenList): AstMatcher {
const op1 = operandStack.pop();
if (typeof op1 === 'undefined') {
if (op1 === undefined) {
return matchNone();
}

View file

@ -7,7 +7,6 @@ export function assertNotNull<T>(value: T | null): T {
}
export function assertNotUndefined<T>(value: T | undefined): T {
// eslint-disable-next-line no-undefined
if (value === undefined) {
throw new Error('Expected non-undefined value');
}

View file

@ -45,7 +45,7 @@ export function getSpoileredTags(): TagData[] {
export function imageHitsTags(img: HTMLElement, matchTags: TagData[]): TagData[] {
const imageTagsString = img.dataset.imageTags;
if (typeof imageTagsString === 'undefined') {
if (imageTagsString === undefined) {
return [];
}
const imageTags = JSON.parse(imageTagsString);

View file

@ -24,7 +24,7 @@ export class UniqueHeap<T> {
const key = this.unique(value);
const prevIndex = this.keys.get(key);
if (typeof prevIndex === 'undefined') {
if (prevIndex === undefined) {
this.keys.set(key, this.length);
this.values[this.length++] = value;
} else if (forceReplace) {