Skip to content

Commit

Permalink
Merge pull request #421 from MareStare/feat/disable-typeof-undefined-…
Browse files Browse the repository at this point in the history
…lint

Disable `no-undefined` ESLint lint
  • Loading branch information
liamwhite authored Feb 13, 2025
2 parents a6fee28 + 351c4cf commit 2ee5159
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion assets/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions assets/js/query/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
}

Expand All @@ -43,7 +43,7 @@ export function parseTokens(lexicalArray: TokenList): AstMatcher {

const op1 = operandStack.pop();

if (typeof op1 === 'undefined') {
if (op1 === undefined) {
return matchNone();
}

Expand Down
1 change: 0 additions & 1 deletion assets/js/utils/assert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down
2 changes: 1 addition & 1 deletion assets/js/utils/tag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion assets/js/utils/unique-heap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 2ee5159

Please sign in to comment.