Improve & simplify tsconfig

This commit is contained in:
Kalle
2026-10-30 16:18:10 +02:00
parent 893a2c8a5b
commit 3445b9c763
8 changed files with 26 additions and 41 deletions

View File

@@ -14,7 +14,7 @@ interface FlipperProps {
export class Flipper extends React.Component<FlipperProps> {
private readonly root = React.createRef<HTMLDivElement>();
getSnapshotBeforeUpdate(prevProps: FlipperProps) {
override getSnapshotBeforeUpdate(prevProps: FlipperProps) {
if (IS_E2E_TEST_RUN) return null;
if (Object.is(prevProps.flipKey, this.props.flipKey)) return null;
if (!this.root.current) return null;
@@ -22,7 +22,7 @@ export class Flipper extends React.Component<FlipperProps> {
return Flip.snapshot(this.root.current);
}
componentDidUpdate(
override componentDidUpdate(
_prevProps: FlipperProps,
_prevState: unknown,
snapshot: Flip.Snapshot | null,
@@ -34,7 +34,7 @@ export class Flipper extends React.Component<FlipperProps> {
});
}
render() {
override render() {
return (
<div ref={this.root} className={this.props.className}>
{this.props.children}

View File

@@ -54,7 +54,7 @@ export class DoubleEliminationBracket extends Bracket {
return result;
}
winnersSourceRound(roundNumber: number) {
override winnersSourceRound(roundNumber: number) {
const isMajorRound = roundNumber === 1 || roundNumber % 2 === 0;
if (!isMajorRound) return;
@@ -243,7 +243,7 @@ export class DoubleEliminationBracket extends Bracket {
return result.reverse();
}
protected matchExits() {
protected override matchExits() {
const result = new Map<number, MatchExit>();
for (const group of this.data.group) {
@@ -356,7 +356,7 @@ export class DoubleEliminationBracket extends Bracket {
return matches.length === 1 ? matches[0] : undefined;
}
get everyMatchOver() {
override get everyMatchOver() {
if (this.preview) return false;
// bracket reset is not played if the winners bracket team wins the grand finals

View File

@@ -8,7 +8,7 @@ import { Bracket, type Standing } from "./Bracket";
import * as Tiebreakers from "./Tiebreakers";
export class RoundRobinBracket extends Bracket {
get collectsKos() {
override get collectsKos() {
return true;
}
@@ -91,7 +91,7 @@ export class RoundRobinBracket extends Bracket {
return this.computeStandings({ includeUnfinishedGroups: false });
}
protected calculateLiveStandings(): Standing[] {
protected override calculateLiveStandings(): Standing[] {
return this.computeStandings({ includeUnfinishedGroups: true });
}
@@ -352,7 +352,7 @@ export class RoundRobinBracket extends Bracket {
return "round_robin";
}
get tiebreakers() {
override get tiebreakers() {
return Tiebreakers.ROUND_ROBIN;
}

View File

@@ -178,7 +178,7 @@ export class SingleEliminationBracket extends Bracket {
.sort((a, b) => a.placement - b.placement);
}
protected matchExits() {
protected override matchExits() {
const result = new Map<number, MatchExit>();
for (const group of this.data.group) {

View File

@@ -77,7 +77,7 @@ export class SwissBracket extends Bracket {
* Rounds are paired one at a time, so a round without matches yet can still change the standings,
* unless it can never be paired because every team already advanced or got eliminated.
*/
get everyMatchOver() {
override get everyMatchOver() {
if (!super.everyMatchOver) return false;
return this.data.group.every((group) => {
@@ -105,7 +105,7 @@ export class SwissBracket extends Bracket {
return this.computeStandings({ includeUnfinishedGroups: false });
}
protected calculateLiveStandings(): Standing[] {
protected override calculateLiveStandings(): Standing[] {
return this.computeStandings({ includeUnfinishedGroups: true });
}
@@ -492,7 +492,7 @@ export class SwissBracket extends Bracket {
return "swiss";
}
get tiebreakers() {
override get tiebreakers() {
return Tiebreakers.SWISS;
}
@@ -511,7 +511,7 @@ export class SwissBracket extends Bracket {
return result;
}
ongoingMatches(): number[] {
override ongoingMatches(): number[] {
// Swiss matches get startedAt at creation time, not via ongoing detection
return [];
}

View File

@@ -36,7 +36,7 @@ export class Masonry extends React.Component<MasonryProps, MasonryState> {
this.state = { columns: [], childRefs: [], hasDistributed: false };
}
componentDidUpdate() {
override componentDidUpdate() {
if (!this.state.hasDistributed && !this.props.sequential) {
this.distributeChildren();
}
@@ -53,7 +53,7 @@ export class Masonry extends React.Component<MasonryProps, MasonryState> {
};
}
shouldComponentUpdate(nextProps: MasonryProps) {
override shouldComponentUpdate(nextProps: MasonryProps) {
return (
nextProps.children !== this.state.children ||
nextProps.columnsCount !== this.props.columnsCount
@@ -144,7 +144,7 @@ export class Masonry extends React.Component<MasonryProps, MasonryState> {
);
}
render() {
override render() {
const { gutter, className, style, containerTag } = this.props;
return React.createElement(

View File

@@ -1,8 +1,5 @@
{
"extends": "../tsconfig.json",
"include": ["./**/*.ts", "../types/**/*.d.ts"],
"exclude": [],
"compilerOptions": {
"allowImportingTsExtensions": true
}
"exclude": []
}

View File

@@ -1,37 +1,25 @@
{
"include": [
"./types/**/*.d.ts",
"**/*.ts",
"**/*.tsx",
".react-router/types/**/*"
],
"include": ["**/*.ts", "**/*.tsx", ".react-router/types/**/*"],
"exclude": ["scripts/**/*", "docs/**/*"],
"compilerOptions": {
"types": ["@react-router/node", "vite/client"],
"rootDirs": [".", "./.react-router/types"],
"lib": ["DOM", "DOM.Iterable", "es2024"],
"module": "ESNext",
"isolatedModules": true,
"erasableSyntaxOnly": true,
"esModuleInterop": true,
"jsx": "react-jsx",
"moduleResolution": "Bundler",
"resolveJsonModule": true,
"target": "ES2022",
"strict": true,
"paths": {
"~/*": ["./app/*"]
},
"target": "ES2024",
"lib": ["DOM", "ES2024"],
"module": "preserve",
"jsx": "react-jsx",
"noEmit": true,
"allowImportingTsExtensions": true,
"forceConsistentCasingInFileNames": true,
"allowJs": false,
"noUncheckedIndexedAccess": false,
"verbatimModuleSyntax": true,
"erasableSyntaxOnly": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noImplicitOverride": true,
"noFallthroughCasesInSwitch": true,
"useUnknownInCatchVariables": true,
"skipLibCheck": true
}
}