[dx] use Biome instead of Prettier, part 2 (#2731)
Biome seems to be MUCH faster than Prettier. Unfortunately, it introduces some formatting changes around the ternary operator, so we have to update files in the repo. To make revert easier if we need it, the change is split into two PRs. This PR introduces a Biome CI check and reformats all files accordingly. ## Change Type - [x] `minor` — New feature
This commit is contained in:
parent
826433751c
commit
e6e4e7f6cb
56 changed files with 286 additions and 264 deletions
|
@ -109,7 +109,9 @@ export async function GET(req: NextRequest) {
|
|||
}
|
||||
})
|
||||
|
||||
Object.keys(results).forEach((section: string) => results[section as keyof Data['results']].sort((a, b) => b.score - a.score))
|
||||
Object.keys(results).forEach((section: string) =>
|
||||
results[section as keyof Data['results']].sort((a, b) => b.score - a.score)
|
||||
)
|
||||
|
||||
results.articles.sort(
|
||||
(a, b) => (b.type === 'heading' ? -1 : 1) - (a.type === 'heading' ? -1 : 1)
|
||||
|
|
|
@ -115,8 +115,8 @@ export function generateSection(section: InputSection, articles: Articles, index
|
|||
section.id === 'getting-started'
|
||||
? `/${articleId}`
|
||||
: isUncategorized
|
||||
? `/${section.id}/${articleId}`
|
||||
: `/${section.id}/${categoryId}/${articleId}`,
|
||||
? `/${section.id}/${articleId}`
|
||||
: `/${section.id}/${categoryId}/${articleId}`,
|
||||
}
|
||||
|
||||
if (isExamples) {
|
||||
|
|
|
@ -161,8 +161,8 @@ export class ContentDatabase {
|
|||
sectionId === 'examples'
|
||||
? this._sidebarExamplesContentLinks
|
||||
: sectionId === 'reference'
|
||||
? this._sidebarReferenceContentLinks
|
||||
: this._sidebarContentLinks
|
||||
? this._sidebarReferenceContentLinks
|
||||
: this._sidebarContentLinks
|
||||
if (cachedLinks && process.env.NODE_ENV !== 'development') {
|
||||
// Use the previously cached sidebar links
|
||||
links = cachedLinks
|
||||
|
|
|
@ -217,8 +217,8 @@ export async function getVectorDb(
|
|||
INCLUDE_API_CONTENT && INCLUDE_CONTENT
|
||||
? await db.all('SELECT * FROM articles')
|
||||
: INCLUDE_API_CONTENT
|
||||
? await db.all('SELECT * FROM articles WHERE articles.sectionId = ?', 'reference')
|
||||
: await db.all('SELECT * FROM articles WHERE articles.sectionId != ?', 'reference')
|
||||
? await db.all('SELECT * FROM articles WHERE articles.sectionId = ?', 'reference')
|
||||
: await db.all('SELECT * FROM articles WHERE articles.sectionId != ?', 'reference')
|
||||
|
||||
nicelog(`Adding articles to index`)
|
||||
const max = Math.min(articles.length, MAX_ARTICLES)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue