[repo] move to Oxlint

This commit is contained in:
Yangshun
2026-03-20 14:56:41 +08:00
parent 84a4ad84d8
commit fa1ec6c7ec
19 changed files with 415 additions and 1916 deletions

View File

@@ -1,11 +0,0 @@
module.exports = {
root: true,
extends: ['tih'],
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
},
rules: {
'@typescript-eslint/ban-ts-comment': 0,
},
};

View File

@@ -1,4 +1,4 @@
import { env } from './src/env/server.mjs';
import './src/env/server.mjs';
/**
* Don't be scared of the generics here.

View File

@@ -6,7 +6,7 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
"lint": "oxlint next.config.mjs src",
"tsc": "tsc",
"postinstall": "prisma generate",
"seed": "ts-node prisma/seed.ts",

View File

@@ -19,7 +19,7 @@ if (_serverEnv.success === false) {
/**
* Validate that server-side environment variables are not exposed to the client.
*/
for (let key of Object.keys(_serverEnv.data)) {
for (const key of Object.keys(_serverEnv.data)) {
if (key.startsWith('NEXT_PUBLIC_')) {
console.warn('❌ You are exposing a server-side env-variable:', key);

View File

@@ -1,9 +1,9 @@
import type { JobType } from '@prisma/client';
export type Profile = {
analysis: ProfileAnalysis?;
background: Background?;
editToken: string?;
analysis?: ProfileAnalysis | null;
background?: Background | null;
editToken?: string | null;
id: string;
isEditable: boolean;
isSaved: boolean;
@@ -20,15 +20,15 @@ export type Background = {
};
export type Experience = {
company: OffersCompany?;
durationInMonths: number?;
company?: OffersCompany | null;
durationInMonths?: number | null;
id: string;
jobType: JobType?;
level: string?;
location: Location?;
monthlySalary: Valuation?;
title: string?;
totalCompensation: Valuation?;
jobType?: JobType | null;
level?: string | null;
location?: Location | null;
monthlySalary?: Valuation | null;
title?: string | null;
totalCompensation?: Valuation | null;
};
export type OffersCompany = {
@@ -50,12 +50,12 @@ export type Valuation = {
};
export type Education = {
endDate: Date?;
field: string?;
endDate?: Date | null;
field?: string | null;
id: string;
school: string?;
startDate: Date?;
type: string?;
school?: string | null;
startDate?: Date | null;
type?: string | null;
};
export type SpecificYoe = {
@@ -87,16 +87,16 @@ export type ProfileOffer = {
location: Location;
monthYearReceived: Date;
negotiationStrategy: string;
offersFullTime: FullTime?;
offersIntern: Intern?;
offersFullTime?: FullTime | null;
offersIntern?: Intern | null;
};
export type FullTime = {
baseSalary: Valuation?;
bonus: Valuation?;
baseSalary?: Valuation | null;
bonus?: Valuation | null;
id: string;
level: string;
stocks: Valuation?;
stocks?: Valuation | null;
title: string;
totalCompensation: Valuation;
};
@@ -113,17 +113,17 @@ export type Reply = {
createdAt: Date;
id: string;
message: string;
replies: Array<Reply>?;
replyingToId: string?;
user: User?;
replies?: Array<Reply> | null;
replyingToId?: string | null;
user?: User | null;
};
export type User = {
email: string?;
emailVerified: Date?;
email?: string | null;
emailVerified?: Date | null;
id: string;
image: string?;
name: string?;
image?: string | null;
name?: string | null;
};
export type GetOffersResponse = {

View File

@@ -9,18 +9,18 @@ export type ResumeComment = Readonly<{
createdAt: Date;
description: string;
id: string;
parentId: string?;
parentId?: string | null;
resumeId: string;
section: ResumesSection;
updatedAt: Date;
user: {
image: string?;
name: string?;
image?: string | null;
name?: string | null;
userId: string;
};
}>;
export type ResumeCommentVote = Readonly<{
numVotes: number;
userVote: ResumesCommentVote?;
userVote?: ResumesCommentVote | null;
}>;

View File

@@ -1,5 +1,5 @@
export type Resume = {
additionalInfo: string?;
additionalInfo?: string | null;
createdAt: Date;
experience: string;
id: string;

View File

@@ -184,7 +184,7 @@ module.exports = {
path: './contents',
routeBasePath: '/',
sidebarPath: require.resolve('./sidebars.js'),
// showLastUpdateAuthor: true,
// ShowLastUpdateAuthor: true,
showLastUpdateTime: true,
},
theme: {

View File

@@ -7,6 +7,7 @@
"start": "docusaurus start",
"dev": "docusaurus start",
"build": "docusaurus build",
"lint": "oxlint docusaurus.config.js sidebars.js src",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy"
},

View File

@@ -70,27 +70,6 @@ function GreatFrontEnd({ position }) {
);
}
function AlgoMonster({ position }) {
return (
<a
className={clsx(styles.container, styles.backgroundAlgoMonster)}
href="https://shareasale.com/r.cfm?b=1873647&u=3114753&m=114505&urllink=&afftrack="
target="_blank"
rel="noopener"
onClick={() => {
window.gtag('event', `algomonster.${position}.click`);
}}>
<p className={styles.tagline}>
<strong className={styles.title}>
Stop grinding mindlessly. Study with a plan
</strong>
Developed by Google engineers, <u>AlgoMonster</u> is the fastest way to
get a software engineering job. <u>Check it out for free!</u>
</p>
</a>
);
}
function DesignGurusSystemDesign({ position }) {
return (
<a
@@ -177,21 +156,6 @@ export default React.memo(function SidebarAd({ position }) {
);
}
// if (
// path.includes('coding') ||
// path.includes('best-practice-questions') ||
// path.includes('mock-interviews') ||
// path.includes('algorithms')
// ) {
// return rand < 0.3 ? (
// <Interviewingio key={Math.random()} position={position} />
// ) : rand < 0.6 ? (
// <AlgoMonster key={Math.random()} position={position} />
// ) : (
// <DesignGurusCoding key={Math.random()} position={position} />
// );
// }
return rand < 0.5 ? (
<FAANGTechLeads key={Math.random()} position={position} />
) : (

View File

@@ -1,7 +1,6 @@
import React from 'react';
import clsx from 'clsx';
import Layout from '@theme/Layout';
import BrowserOnly from '@docusaurus/BrowserOnly';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import Link from '@docusaurus/Link';
import useBaseUrl from '@docusaurus/useBaseUrl';
@@ -11,11 +10,10 @@ import successStories from '../data/successStories';
const BLIND_75_URL =
'https://www.teamblind.com/post/New-Year-Gift---Curated-List-of-Top-75-LeetCode-Questions-to-Save-Your-Time-OaM1orEU';
const BLIND_OFFER_NUMBERS_URL =
'https://www.teamblind.com/post/Sharing-my-offer-numbers-from-big-companies-for-your-reference-yNgqUPQR';
const FEATURES = [
{
id: 'zero-to-hero',
title: <>💯 Go From zero to hero</>,
description: (
<>
@@ -26,6 +24,7 @@ const FEATURES = [
link: '/software-engineering-interview-guide/',
},
{
id: 'curated-practice',
title: <>📝 Curated practice questions</>,
description: (
<>
@@ -39,6 +38,7 @@ const FEATURES = [
link: '/coding-interview-study-plan/',
},
{
id: 'best-practices',
title: <>📋 Interview best practices</>,
description: (
<>
@@ -49,6 +49,7 @@ const FEATURES = [
link: '/coding-interview-cheatsheet/',
},
{
id: 'algorithm-tips',
title: <>💁 Practical algorithm tips</>,
description: (
<>
@@ -59,6 +60,7 @@ const FEATURES = [
link: '/algorithms/study-cheatsheet/',
},
{
id: 'behavioral',
title: <>💬 Behavioral questions</>,
description: (
<>
@@ -69,6 +71,7 @@ const FEATURES = [
link: '/behavioral-interview-questions/',
},
{
id: 'tested',
title: <>🧪 Tested and proven</>,
description: (
<>
@@ -220,48 +223,6 @@ function WhatIsThisSection() {
);
}
function RoraSection() {
// Because the SSR and client output can differ and hydration doesn't patch attribute differences,
// we'll render this on the browser only.
return (
<BrowserOnly>
{() => (
<div className={clsx('padding-vert--lg', styles.sectionSponsor)}>
<div className="container">
<div className="row">
<div className="col col--8 col--offset-2">
<div className="margin-vert--lg text--center">
<div>
<h2 className={styles.sectionSponsorTitle}>
<strong>
Get paid more. Receive risk-free salary negotiation
advice from Rora. You pay nothing unless your offer is
increased.
</strong>
</h2>
<div className="margin-vert--lg">
<a
className="button button--secondary button--lg"
href="https://www.teamrora.com/?utm_source=techinterviewhandbook&utm_medium=referral&utm_content=website_homepage"
rel="noopener"
target="_blank"
onClick={() => {
window.gtag('event', 'rora.homepage.click');
}}>
Get risk-free negotiation advice&nbsp;&nbsp;
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
)}
</BrowserOnly>
);
}
function HowToUseStep({ index, title, ctaLink, contents }) {
return (
<div className={clsx('card', styles.howToUseStep)}>
@@ -273,8 +234,8 @@ function HowToUseStep({ index, title, ctaLink, contents }) {
</div>
<div className="card__body">
<ul>
{contents.map((content, i) => (
<li key={i}>{content}</li>
{contents.map((content) => (
<li key={content}>{content}</li>
))}
</ul>
</div>
@@ -325,9 +286,9 @@ function HowToUseSection() {
index={1}
title={<>Prepare a FAANG-ready resume</>}
contents={[
<>Create an ATS-proof resume</>,
<>Software engineering specific resume content</>,
<>Optimizing and testing your resume</>,
'Create an ATS-proof resume',
'Software engineering specific resume content',
'Optimizing and testing your resume',
]}
ctaLink="/resume/"
/>
@@ -338,10 +299,10 @@ function HowToUseSection() {
index={2}
title={<>Ace the interviews</>}
contents={[
<>Step-by-step coding interview preparation</>,
<>Algorithms deep dive</>,
<>System design interview preparation</>,
<>Behavioral interview preparation</>,
'Step-by-step coding interview preparation',
'Algorithms deep dive',
'System design interview preparation',
'Behavioral interview preparation',
]}
ctaLink="/coding-interview-prep/"
/>
@@ -352,8 +313,8 @@ function HowToUseSection() {
index={3}
title={<>Negotiate the best offer</>}
contents={[
<>Negotiation strategies for software engineers</>,
<>Guide on how compensation works for software engineers</>,
'Negotiation strategies for software engineers',
'Guide on how compensation works for software engineers',
]}
ctaLink="/understanding-compensation/"
/>
@@ -363,10 +324,7 @@ function HowToUseSection() {
<HowToUseStep
index={4}
title={<>Prepare for the job</>}
contents={[
<>How to choose between companies</>,
<>Guide to engineering levels</>,
]}
contents={['How to choose between companies', 'Guide to engineering levels']}
ctaLink="/choosing-between-companies"
/>
</div>
@@ -394,9 +352,9 @@ function FeaturesSection() {
We have everything you need - all straight to the point
</h3>
<div className={clsx('row', styles.featuresRow)}>
{FEATURES.map(({ title, description, link }, idx) => (
{FEATURES.map(({ id, title, description, link }) => (
<div
key={idx}
key={id}
className={clsx(
'col',
'col--4',
@@ -471,7 +429,7 @@ function GreatFrontEndSection() {
<div className="margin-vert--lg text--center">
<div>
<h2>
<span class="badge badge--secondary">
<span className="badge badge--secondary">
LeetCode for Front End Interviews
</span>
</h2>