Skip to content

Commit 9955df5

Browse files
committed
chore: linting
1 parent 339c15d commit 9955df5

File tree

10 files changed

+14
-14
lines changed

10 files changed

+14
-14
lines changed

src/__tests__/abstract-extractor-plugin.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { beforeEach, describe, expect, it } from 'bun:test'
2+
import { load } from 'cheerio'
23
import {
34
NotImplementedException,
45
UnsupportedFieldException,
56
} from '@/exceptions'
6-
import { load } from 'cheerio'
77
import { ExtractorPlugin } from '../abstract-extractor-plugin'
88
import type { RecipeFields } from '../types/recipe.interface'
99

@@ -94,7 +94,7 @@ class ThrowingExtractorPlugin extends ExtractorPlugin {
9494
super($)
9595
}
9696

97-
supports(field: keyof RecipeFields): boolean {
97+
supports(_field: keyof RecipeFields): boolean {
9898
return true
9999
}
100100

src/__tests__/logger.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { afterEach, beforeEach, describe, expect, it, spyOn } from 'bun:test'
2-
import { LogLevel, Logger } from '../logger'
2+
import { Logger, LogLevel } from '../logger'
33

44
describe('Logger', () => {
55
let consoleSpy: {

src/abstract-scraper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as cheerio from 'cheerio'
22
import type { ExtractorPlugin } from './abstract-extractor-plugin'
33
import type { PostProcessorPlugin } from './abstract-postprocessor-plugin'
44
import { NotImplementedException } from './exceptions'
5-
import { LogLevel, Logger } from './logger'
5+
import { Logger, LogLevel } from './logger'
66
import { PluginManager } from './plugin-manager'
77
import { HtmlStripperPlugin } from './plugins/html-stripper.processor'
88
import { OpenGraphPlugin } from './plugins/opengraph.extractor'

src/plugins/__tests__/opengraph.extractor.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { beforeEach, describe, expect, it } from 'bun:test'
2+
import { load } from 'cheerio'
23
import { ExtractorNotFoundException } from '@/exceptions'
34
import type { RecipeFields } from '@/types/recipe.interface'
4-
import { load } from 'cheerio'
55
import { OpenGraphException, OpenGraphPlugin } from '../opengraph.extractor'
66

77
describe('OpenGraphPlugin', () => {

src/plugins/schema-org.extractor/__tests__/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { describe, expect, it } from 'bun:test'
2+
import { load } from 'cheerio'
23
import {
34
ExtractionFailedException,
45
UnsupportedFieldException,
56
} from '@/exceptions'
67
import type { RecipeFields } from '@/types/recipe.interface'
78
import { isList } from '@/utils/ingredients'
8-
import { load } from 'cheerio'
99
import { SchemaOrgException, SchemaOrgPlugin } from '../index'
1010

1111
const minimalJsonLd = `

src/plugins/schema-org.extractor/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1+
import type { CheerioAPI } from 'cheerio'
2+
import type { AggregateRating } from 'schema-dts'
13
import { ExtractorPlugin } from '@/abstract-extractor-plugin'
24
import {
35
ExtractionFailedException,
46
UnsupportedFieldException,
57
} from '@/exceptions'
6-
import { type LogLevel, Logger } from '@/logger'
8+
import { Logger, type LogLevel } from '@/logger'
79
import type { RecipeFields } from '@/types/recipe.interface'
810
import { isFunction, isNumber, isPlainObject, isString } from '@/utils'
911
import { splitInstructions } from '@/utils/instructions'
1012
import { extractRecipeMicrodata } from '@/utils/microdata'
1113
import { parseYields } from '@/utils/parse-yields'
1214
import { normalizeString, parseMinutes, splitToList } from '@/utils/parsing'
13-
import type { CheerioAPI } from 'cheerio'
14-
import type { AggregateRating } from 'schema-dts'
1515
import type {
1616
Person,
1717
SchemaOrgData,
@@ -156,7 +156,7 @@ export class SchemaOrgPlugin extends ExtractorPlugin {
156156
value: unknown,
157157
props: string[] = ['textValue', 'name', 'title', '@id'],
158158
): string {
159-
let text = undefined
159+
let text: string | undefined
160160

161161
if (isString(value)) {
162162
text = value

src/plugins/schema-org.extractor/type-predicates.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { isPlainObject, isString } from '@/utils'
21
import type {
32
AggregateRating,
43
HowToSection,
@@ -8,6 +7,7 @@ import type {
87
WebPage,
98
WebSite,
109
} from 'schema-dts'
10+
import { isPlainObject, isString } from '@/utils'
1111
import type { Graph, Person, Recipe, Thing } from './schema-org.interface'
1212

1313
export function hasId(obj: Thing): obj is Thing & { '@id': string } {

src/recipe-extractor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
ExtractionFailedException,
55
ExtractorNotFoundException,
66
} from './exceptions'
7-
import { type LogLevel, Logger } from './logger'
7+
import { Logger, type LogLevel } from './logger'
88
import type { RecipeFields } from './types/recipe.interface'
99
import { isDefined } from './utils'
1010

src/utils/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export function isDefined<T>(value: T | undefined): value is T {
22
return value !== undefined
33
}
44

5-
// biome-ignore lint/complexity/noBannedTypes: <explanation>
5+
// biome-ignore lint/complexity/noBannedTypes: allowed here
66
export function isFunction(value: unknown): value is Function {
77
return typeof value === 'function'
88
}

src/utils/ingredients.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1+
import type { CheerioAPI } from 'cheerio'
12
import type {
23
IngredientGroup,
34
Ingredients,
45
IngredientsList,
56
List,
67
RecipeObject,
78
} from '@/types/recipe.interface'
8-
import type { CheerioAPI } from 'cheerio'
99
import { isString } from '.'
1010
import { normalizeString } from './parsing'
1111

0 commit comments

Comments
 (0)