mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-02-19 03:44:23 +01:00
Disable no-undefined
ESLint lint
This commit is contained in:
parent
a6fee28bf8
commit
351c4cff19
5 changed files with 5 additions and 6 deletions
|
@ -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,
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue