Skip to content

Commit 7062d19

Browse files
refactor: remove linter warnings (#2063)
1 parent 4422cba commit 7062d19

File tree

19 files changed

+118
-114
lines changed

19 files changed

+118
-114
lines changed

.storybook/main.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ const config = {
88
features: {
99
backgrounds: false,
1010
},
11-
async viteFinal(config) {
12-
config.plugins ??= []
11+
async viteFinal(newConfig) {
12+
newConfig.plugins ??= []
1313

14-
config.plugins.push({
14+
newConfig.plugins.push({
1515
name: 'ignore-internals',
1616
transform(_, id) {
1717
if (id.includes('/app/pages/blog/') && id.endsWith('.md')) {
@@ -23,7 +23,7 @@ const config = {
2323
// vue-docgen-api can crash on components that import types from other
2424
// .vue files (it tries to parse the SFC with @babel/parser as plain TS).
2525
// This wrapper catches those errors so the build doesn't fail.
26-
const docgenPlugin = config.plugins?.find(
26+
const docgenPlugin = newConfig.plugins?.find(
2727
(p): p is Extract<typeof p, { name: string }> =>
2828
!!p && typeof p === 'object' && 'name' in p && p.name === 'storybook:vue-docgen-plugin',
2929
)
@@ -48,7 +48,7 @@ const config = {
4848
}
4949
}
5050

51-
return config
51+
return newConfig
5252
},
5353
} satisfies StorybookConfig
5454

app/components/Compare/FacetBarChart.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ const config = computed<VueUiHorizontalBarConfig>(() => {
178178
bold: false,
179179
color: colors.value.fg,
180180
value: {
181-
formatter: ({ config }) => {
182-
return config?.datapoint?.formattedValue ?? '0'
181+
formatter: ({ config: formatterConfig }) => {
182+
return formatterConfig?.datapoint?.formattedValue ?? '0'
183183
},
184184
},
185185
},

app/composables/npm/useUserPackages.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export function useUserPackages(username: MaybeRefOrGetter<string>) {
4747

4848
const asyncData = useLazyAsyncData(
4949
() => `user-packages:${searchProviderValue.value}:${toValue(username)}`,
50-
async ({ $npmRegistry }, { signal }) => {
50+
async (_nuxtApp, { signal }) => {
5151
const user = toValue(username)
5252
if (!user) {
5353
return emptySearchResponse()

app/composables/useBlogPostBlueskyLink.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ export function useBlogPostBlueskyLink(slug: MaybeRefOrGetter<string | null | un
7272
// TODO: Will need to remove this console error to satisfy linting scan
7373
// Constellation unavailable or error - fail silently
7474
// But during dev we will get an error
75+
// oxlint-disable-next-line no-console
7576
if (import.meta.dev) console.error('[Bluesky] Constellation error:', error)
7677
}
7778

app/composables/useFacetSelection.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ export interface FacetInfoWithLabels extends Omit<FacetInfo, 'id'> {
66
chartable: boolean
77
}
88

9+
// Get facets in a category (excluding coming soon)
10+
function getFacetsInCategory(category: string): ComparisonFacet[] {
11+
return ALL_FACETS.filter(f => {
12+
const info = FACET_INFO[f]
13+
return info.category === category && !info.comingSoon
14+
})
15+
}
16+
917
/**
1018
* Composable for managing comparison facet selection with URL sync.
1119
*
@@ -150,14 +158,6 @@ export function useFacetSelection(queryParam = 'facets') {
150158
}
151159
}
152160

153-
// Get facets in a category (excluding coming soon)
154-
function getFacetsInCategory(category: string): ComparisonFacet[] {
155-
return ALL_FACETS.filter(f => {
156-
const info = FACET_INFO[f]
157-
return info.category === category && !info.comingSoon
158-
})
159-
}
160-
161161
// Select all facets in a category
162162
function selectCategory(category: string): void {
163163
const categoryFacets = getFacetsInCategory(category)

app/composables/useMarkdown.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,20 +88,20 @@ function parseMarkdown({ text, packageName, plain }: UseMarkdownOptions): string
8888
html = html.replace(/~~(.+?)~~/g, '<del>$1</del>')
8989

9090
// Links: [text](url) - only allow https, mailto
91-
html = html.replace(/\[([^\]]+)\]\(([^)]+)\)/g, (_match, text, url) => {
91+
html = html.replace(/\[([^\]]+)\]\(([^)]+)\)/g, (_match, textGroup, url) => {
9292
// In plain mode, just render the link text without the anchor
9393
if (plain) {
94-
return text
94+
return textGroup
9595
}
9696
const decodedUrl = url.replace(/&amp;/g, '&')
9797
try {
9898
const { protocol, href } = new URL(decodedUrl)
9999
if (['https:', 'mailto:'].includes(protocol)) {
100100
const safeUrl = href.replace(/"/g, '&quot;')
101-
return `<a href="${safeUrl}" rel="nofollow noreferrer noopener" target="_blank">${text}</a>`
101+
return `<a href="${safeUrl}" rel="nofollow noreferrer noopener" target="_blank">${textGroup}</a>`
102102
}
103103
} catch {}
104-
return `${text} (${url})`
104+
return `${textGroup} (${url})`
105105
})
106106

107107
return html

app/pages/search.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -393,12 +393,12 @@ const exactMatchType = computed<'package' | 'org' | 'user' | null>(() => {
393393
const suggestionCount = computed(() => validatedSuggestions.value.length)
394394
const totalSelectableCount = computed(() => suggestionCount.value + resultCount.value)
395395
396+
const isVisible = (el: HTMLElement) => el.getClientRects().length > 0
397+
396398
/**
397399
* Get all focusable result elements in DOM order (suggestions first, then packages)
398400
*/
399401
function getFocusableElements(): HTMLElement[] {
400-
const isVisible = (el: HTMLElement) => el.getClientRects().length > 0
401-
402402
const suggestions = Array.from(document.querySelectorAll<HTMLElement>('[data-suggestion-index]'))
403403
.filter(isVisible)
404404
.sort((a, b) => {
@@ -435,7 +435,7 @@ async function navigateToPackage(packageName: string) {
435435
const pendingEnterQuery = shallowRef<string | null>(null)
436436
437437
// Watch for results to navigate when Enter was pressed before results arrived
438-
watch(displayResults, results => {
438+
watch(displayResults, newResults => {
439439
if (!pendingEnterQuery.value) return
440440
441441
// Check if input is still focused (user hasn't started navigating or clicked elsewhere)
@@ -445,7 +445,7 @@ watch(displayResults, results => {
445445
}
446446
447447
// Navigate if first result matches the query that was entered
448-
const firstResult = results[0]
448+
const firstResult = newResults[0]
449449
// eslint-disable-next-line no-console
450450
console.log('[search] watcher fired', {
451451
pending: pendingEnterQuery.value,

app/pages/settings.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ defineOgImageComponent('Default', {
3636
primaryColor: '#60a5fa',
3737
})
3838
39-
const setLocale: typeof setNuxti18nLocale = locale => {
40-
settings.value.selectedLocale = locale
41-
return setNuxti18nLocale(locale)
39+
const setLocale: typeof setNuxti18nLocale = newLocale => {
40+
settings.value.selectedLocale = newLocale
41+
return setNuxti18nLocale(newLocale)
4242
}
4343
</script>
4444

app/utils/download-anomalies.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export function applyBlocklistCorrection(opts: {
9898
if (!anomalies.length) return data
9999

100100
// Clone to avoid mutation
101-
const result = (data as Array<Record<string, any>>).map(d => ({ ...d }))
101+
const result = (data as Array<Record<string, any>>).map(d => Object.assign({}, d))
102102

103103
for (const anomaly of anomalies) {
104104
// Find indices of affected points

cli/src/mock-state.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,10 @@ export class MockConnectorStateManager {
229229
}
230230

231231
approveOperation(id: string): PendingOperation | null {
232-
const op = this.state.operations.find(op => op.id === id)
233-
if (!op || op.status !== 'pending') return null
234-
op.status = 'approved'
235-
return op
232+
const operation = this.state.operations.find(op => op.id === id)
233+
if (!operation || operation.status !== 'pending') return null
234+
operation.status = 'approved'
235+
return operation
236236
}
237237

238238
approveAll(): number {
@@ -247,11 +247,11 @@ export class MockConnectorStateManager {
247247
}
248248

249249
retryOperation(id: string): PendingOperation | null {
250-
const op = this.state.operations.find(op => op.id === id)
251-
if (!op || op.status !== 'failed') return null
252-
op.status = 'approved'
253-
op.result = undefined
254-
return op
250+
const operation = this.state.operations.find(op => op.id === id)
251+
if (!operation || operation.status !== 'failed') return null
252+
operation.status = 'approved'
253+
operation.result = undefined
254+
return operation
255255
}
256256

257257
/** Execute all approved operations (mock: instant success unless configured otherwise). */

0 commit comments

Comments
 (0)