Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/composables/npm/useAlgoliaSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import {
type SearchResponse,
} from 'algoliasearch/lite'

// oxlint-disable-next-line eslint/no-underscore-dangle
let _searchClient: LiteClient | null = null
// oxlint-disable-next-line eslint/no-underscore-dangle
let _configuredAppId: string | null = null

function getOrCreateClient(appId: string, apiKey: string): LiteClient {
Expand Down
2 changes: 2 additions & 0 deletions app/composables/npm/usePackage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ export function transformPackument(
: undefined

return {
// oxlint-disable-next-line eslint/no-underscore-dangle
'_id': pkg._id,
// oxlint-disable-next-line eslint/no-underscore-dangle
'_rev': pkg._rev,
'name': pkg.name,
'description': pkg.description,
Expand Down
4 changes: 3 additions & 1 deletion app/composables/useStructuredFilters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ function matchesSecurity(pkg: NpmSearchResult, security: SecurityFilter): boolea

/**
* Composable for structured filtering and sorting of package lists
*
*/
export function useStructuredFilters(options: UseStructuredFiltersOptions) {
const route = useRoute()
Expand Down Expand Up @@ -277,6 +276,7 @@ export function useStructuredFilters(options: UseStructuredFiltersOptions) {
}
}

// oxlint-disable-next-line unicorn/consistent-function-scoping
function matchesDownloadRange(pkg: NpmSearchResult, range: DownloadRange): boolean {
if (range === 'any') return true
const downloads = pkg.downloads?.weekly ?? 0
Expand All @@ -287,6 +287,7 @@ export function useStructuredFilters(options: UseStructuredFiltersOptions) {
return true
}

// oxlint-disable-next-line unicorn/consistent-function-scoping
function matchesUpdatedWithin(pkg: NpmSearchResult, within: UpdatedWithin): boolean {
if (within === 'any') return true
const config = UPDATED_WITHIN_OPTIONS.find(o => o.value === within)
Expand All @@ -311,6 +312,7 @@ export function useStructuredFilters(options: UseStructuredFiltersOptions) {
})

// Sort comparators
// oxlint-disable-next-line unicorn/consistent-function-scoping
function comparePackages(a: NpmSearchResult, b: NpmSearchResult, option: SortOption): number {
const { key, direction } = parseSortOption(option)
const multiplier = direction === 'asc' ? 1 : -1
Expand Down
1 change: 1 addition & 0 deletions app/plugins/payload-cache.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export default defineNuxtPlugin({
// The Nitro payload-cache plugin will pick this up in render:response
const event = ssrContext.event
if (event) {
// oxlint-disable-next-line eslint/no-underscore-dangle
event.context._cachedPayloadResponse = {
body,
statusCode: 200,
Expand Down
1 change: 1 addition & 0 deletions app/utils/charts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ export function computeLineChartAnalysis(values: Array<number | null>): LineChar
}
}

// oxlint-disable-next-line eslint/no-underscore-dangle
let _sum = 0
for (const entry of indexedValues) {
_sum += entry.value
Expand Down
3 changes: 3 additions & 0 deletions app/utils/colors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,11 @@ export function oklchToHex(color: string | undefined | null): string | undefined
const a = chroma * Math.cos(hRad)
const b = chroma * Math.sin(hRad)

// oxlint-disable-next-line eslint/no-underscore-dangle
let l_ = lightness + 0.3963377774 * a + 0.2158037573 * b
// oxlint-disable-next-line eslint/no-underscore-dangle
let m_ = lightness - 0.1055613458 * a - 0.0638541728 * b
// oxlint-disable-next-line eslint/no-underscore-dangle
let s_ = lightness - 0.0894841775 * a - 1.291485548 * b

l_ = l_ ** 3
Expand Down
2 changes: 1 addition & 1 deletion cli/src/mock-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type {
import type { MockConnectorStateManager } from './mock-state.ts'

// Endpoint completeness check — errors if this list diverges from ConnectorEndpoints.
// oxlint-disable-next-line no-unused-vars
// oxlint-disable-next-line no-unused-vars, eslint/no-underscore-dangle
const _endpointCheck: AssertEndpointsImplemented<
| 'POST /connect'
| 'GET /state'
Expand Down
1 change: 1 addition & 0 deletions cli/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import type {
} from './types.ts'

// Endpoint completeness check — errors if this list diverges from ConnectorEndpoints.
// oxlint-disable-next-line eslint/no-underscore-dangle
const _endpointCheck: AssertEndpointsImplemented<
| 'POST /connect'
| 'GET /state'
Expand Down
11 changes: 3 additions & 8 deletions knip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,15 @@ const config: KnipConfig = {
entry: [
'i18n/**/*.ts',
'lunaria.config.ts',
'lunaria/lunaria.ts',
'pwa-assets.config.ts',
'modules/*.ts',
'.lighthouserc.cjs',
'lighthouse-setup.cjs',
'uno-preset-*.ts!',
'scripts/**/*.ts',
'{*,.github/*,app/pages/blog/**}.md',
],
project: [
'**/*.{ts,vue,cjs,mjs}',
'**/*.{ts,vue,cjs,mjs,md,mdx}',
'!test/fixtures/**',
'!test/test-utils/**',
'!test/e2e/helpers/**',
Expand All @@ -36,10 +35,6 @@ const config: KnipConfig = {
/** Optional peer dependency of @nuxt/vite-builder for the rolldown-powered build */
'rolldown',

/** Oxlint plugins don't get picked up yet */
'@e18e/eslint-plugin',
'eslint-plugin-regexp',

/** Used in test/e2e/helpers/ which is excluded from knip project scope */
'h3-next',
],
Expand All @@ -55,7 +50,7 @@ const config: KnipConfig = {
},
'docs': {
entry: ['app/**/*.{ts,vue,css}', 'shared/**/*.{ts,vue,css}'],
project: ['**/*.{ts,vue,cjs,mjs}'],
project: ['**/*.{ts,vue,cjs,mjs,css}'],
ignoreDependencies: ['@nuxtjs/mdc'],
},
},
Expand Down
3 changes: 3 additions & 0 deletions lunaria/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ const TitleParagraph = html`

// Components from here are not used at the moment
// Do not delete as we might use it if we split translations in multiple files for locale
// oxlint-disable-next-line eslint/no-underscore-dangle
const _StatusByFile = (
config: LunariaConfig,
status: LunariaStatus,
Expand Down Expand Up @@ -302,13 +303,15 @@ const EmojiFileLink = (
</span>`
}

// oxlint-disable-next-line eslint/no-underscore-dangle
const _CreateFileLink = (href: string, text: string): string => {
return html`<a class="create-button" href="${href}">${text}</a>`
}

/**
* Build an SVG file showing a summary of each language's translation progress.
*/
// oxlint-disable-next-line eslint/no-underscore-dangle
const _SvgSummary = (config: LunariaConfig, status: LunariaStatus): string => {
const localeHeight = 56 // Each locale’s summary is 56px high.
const svgHeight = localeHeight * Math.ceil(config.locales.length / 2)
Expand Down
1 change: 1 addition & 0 deletions modules/blog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ export default defineNuxtModule({
const resolver = createResolver(import.meta.url)
const blogDir = resolver.resolve('../app/pages/blog')
const blogImagesDir = resolver.resolve('../public/blog/avatar')
// oxlint-disable-next-line eslint/no-underscore-dangle
const resolveAvatars = !nuxt.options._prepare

nuxt.options.extensions.push('.md')
Expand Down
1 change: 1 addition & 0 deletions modules/image-proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export default defineNuxtModule({
setup() {
const nuxt = useNuxt()

// oxlint-disable-next-line eslint/no-underscore-dangle
if (nuxt.options._prepare || process.env.NUXT_IMAGE_PROXY_SECRET) {
return
}
Expand Down
1 change: 1 addition & 0 deletions modules/lunaria.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default defineNuxtModule({
maxAge: 60 * 60 * 24, // 1 day
})

// oxlint-disable-next-line eslint/no-underscore-dangle
if (nuxt.options.dev || nuxt.options._prepare || nuxt.options.test || isTest) {
return
}
Expand Down
1 change: 1 addition & 0 deletions modules/oauth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default defineNuxtModule({
getContents: () => `export const clientUri = ${JSON.stringify(clientUri)};`,
})

// oxlint-disable-next-line eslint/no-underscore-dangle
if (nuxt.options._prepare || process.env.NUXT_SESSION_PASSWORD) {
return
}
Expand Down
1 change: 1 addition & 0 deletions modules/standard-site-sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export default defineNuxtModule({
const { pdsUrl, handle, password } = config

// Skip auth during prepare phase (nuxt prepare, nuxt generate --prepare, etc)
// oxlint-disable-next-line eslint/no-underscore-dangle
if (nuxt.options._prepare) return

const pdsPublicClient = new Client({ service: pdsUrl })
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
"vue-router": "5.1.0"
},
"devDependencies": {
"@e18e/eslint-plugin": "0.5.1",
"@e18e/eslint-plugin": "0.6.0",
"@intlify/core-base": "11.4.6",
"@npm/types": "2.1.0",
"@playwright/test": "1.61.1",
Expand All @@ -138,7 +138,7 @@
"fast-check": "4.8.0",
"h3": "1.15.11",
"h3-next": "npm:h3@2.0.1-rc.22",
"knip": "6.24.0",
"knip": "6.31.0",
"markdown-it-anchor": "9.2.0",
"msw": "catalog:msw",
"msw-storybook-addon": "catalog:storybook",
Expand Down
Loading
Loading