Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
67639f1
refactor: tsdown
lishaduck Dec 26, 2025
bbabb56
chore: attw
lishaduck Dec 27, 2025
a024277
feat: extract out ts patching package
lishaduck Dec 28, 2025
1c36ef2
Merge branch 'main'
JoshuaKGoldberg Dec 28, 2025
967a64d
Merge branch 'main'
JoshuaKGoldberg Dec 28, 2025
8d7351f
fix: delete tsconfig.tsbuildinfos again
lishaduck Dec 28, 2025
55bcbfb
improvements
lishaduck Dec 28, 2025
a43eb4d
fix: knip
lishaduck Dec 28, 2025
73c3a6e
fix lockfile
lishaduck Dec 28, 2025
e9d570a
ci: cleanup
lishaduck Dec 28, 2025
7918250
fix: typechecking
lishaduck Dec 28, 2025
3270fd0
chore: drop spelling because I'm here
lishaduck Dec 28, 2025
e7e8a06
fix: wrap test name in quotes 😂
lishaduck Dec 28, 2025
3516a84
ci: create .astro before linting
lishaduck Dec 28, 2025
fbead69
ci: satiate the knip ✂️
lishaduck Dec 28, 2025
833060d
chore: update perfectionist to sort types with values
lishaduck Dec 29, 2025
34b22b0
chore: use type specifiers across the board
lishaduck Dec 29, 2025
49e0f98
chore: import from ts, not js
lishaduck Dec 29, 2025
f5777f9
chore: enforce ts extensions over js
lishaduck Dec 29, 2025
f808df1
feat: erasableSyntaxOnly
lishaduck Dec 29, 2025
e5af340
Merge branch 'main' into tsdown
lishaduck Dec 29, 2025
b9acbd8
fix: let tsdown build references
lishaduck Dec 29, 2025
077ff4b
ci: drop now-redundant tsc build
lishaduck Dec 29, 2025
af62d25
Merge branch 'tsdown' into dotts
lishaduck Dec 29, 2025
25cae5d
fix: migrate new batch of rules
lishaduck Dec 29, 2025
4a88c0c
chore: js isn't real
lishaduck Dec 29, 2025
e07721a
Merge branch 'tsdown' into dotts
lishaduck Dec 29, 2025
a73a4b6
smaller diff
lishaduck Dec 29, 2025
7d404d3
fix: revert whitespace changes in tests
lishaduck Dec 29, 2025
700ad8e
chore: allow ts extensions in site as well
lishaduck Dec 29, 2025
79705fd
Merge branch 'main' into ts-patch
lishaduck Dec 29, 2025
e87589b
rm tsconfig.tsbuildinfo
lishaduck Dec 29, 2025
3972957
simpler
lishaduck Dec 29, 2025
908a76f
chore: drop unneeded node types
lishaduck Dec 29, 2025
bc4e440
fix: simpler design
lishaduck Dec 29, 2025
5c796d3
fix: lints
lishaduck Dec 29, 2025
4464091
Merge branch 'tsdown' into dotts
lishaduck Dec 29, 2025
15c1d7a
fix: for simpler setup
lishaduck Dec 29, 2025
bfe3d95
even smaller package
lishaduck Dec 29, 2025
07723fc
Merge branch 'tsdown' into dotts
lishaduck Dec 29, 2025
d189bda
drop more typescripts
lishaduck Dec 29, 2025
252d2a7
improve packaging
lishaduck Dec 29, 2025
74c9865
Merge branch 'ts-patch' into tsdown
lishaduck Dec 29, 2025
e9a3c66
fix: references with simpler setup
lishaduck Dec 29, 2025
b2e9e18
fix: source map subpath
lishaduck Dec 29, 2025
ad79e2c
Merge branch 'ts-patch' into tsdown
lishaduck Dec 29, 2025
11012d2
Merge branch 'tsdown' into dotts
lishaduck Dec 29, 2025
b9f6166
fix: drop entries from publishconfig
lishaduck Dec 29, 2025
d710005
chore: improve internal tsconfig options for improved dx (#1174)
lishaduck Dec 30, 2025
8dbeb23
Revert "chore: improve internal tsconfig options for improved dx (#11…
lishaduck Dec 30, 2025
675d0cd
Merge branch 'main' into tsdown
lishaduck Dec 30, 2025
85e44df
Revert "chore: drop spelling because I'm here"
lishaduck Dec 30, 2025
b00e4df
diff
lishaduck Dec 30, 2025
9b887c9
refactor: use tsconfig.test.json
lishaduck Dec 30, 2025
dee7258
Merge branch 'main' into tsdown
lishaduck Dec 30, 2025
b7f34bd
Merge branch 'tsdown' into dotts
lishaduck Dec 30, 2025
b910535
Merge branch 'main' into tsdown
lishaduck Dec 30, 2025
ad59dd2
Merge branch 'tsdown' into dotts
lishaduck Dec 30, 2025
641d6a1
chore: disable rewriteRelativeImportExtensions
lishaduck Dec 31, 2025
e453268
chore: attw only in ci
lishaduck Dec 31, 2025
940face
chore: add changeset
lishaduck Jan 1, 2026
6d71229
chore: remove root lib from prettier
lishaduck Jan 1, 2026
bf64e6d
Merge branch 'main' into tsdown
lishaduck Jan 2, 2026
a80eda5
Merge branch 'main' into tsdown
lishaduck Jan 2, 2026
3f6b656
Merge branch 'tsdown' into dotts
lishaduck Jan 2, 2026
0c15043
fix: use more ts extensions
lishaduck Jan 2, 2026
606c66e
Merge branch 'main' into dotts
lishaduck Jan 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
56 changes: 52 additions & 4 deletions eslint.config.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,48 @@
import type { Linter } from "eslint";

import comments from "@eslint-community/eslint-plugin-eslint-comments/configs";
import eslint from "@eslint/js";
import markdown from "@eslint/markdown";
import comments from "@eslint-community/eslint-plugin-eslint-comments/configs";
import vitest from "@vitest/eslint-plugin";
import type { Linter } from "eslint";
import { defineConfig, globalIgnores } from "eslint/config";
import jsdoc from "eslint-plugin-jsdoc";
import jsonc from "eslint-plugin-jsonc";
import n from "eslint-plugin-n";
import packageJson from "eslint-plugin-package-json";
import perfectionist from "eslint-plugin-perfectionist";
import { Alphabet } from "eslint-plugin-perfectionist/alphabet";
import * as regexp from "eslint-plugin-regexp";
import yml from "eslint-plugin-yml";
import { defineConfig, globalIgnores } from "eslint/config";
import tseslint from "typescript-eslint";

const importAlphabet = Alphabet.generateRecommendedAlphabet()
.sortByNaturalSort()
.placeCharacterBefore({ characterAfter: "-", characterBefore: "/" })
.placeCharacterBefore({ characterAfter: "/", characterBefore: "." })
.getCharacters();

// https://typescript-eslint.io/troubleshooting/typed-linting/performance#importextensions-enforcing-extensions-are-not-used
function banJsImportExtension() {
const message = `Unexpected use of .js file extension (.js) in import; please use .ts`;
const literalAttributeMatcher = `Literal[value=/\\.js$/]`;
return [
{
message,
// import foo from 'bar.js';
selector: `ImportDeclaration > ${literalAttributeMatcher}.source`,
},
{
message,
// export { foo } from 'bar.js';
selector: `ExportNamedDeclaration > ${literalAttributeMatcher}.source`,
},
{
message,
// type Foo = typeof import('bar.js');
selector: `TSImportType > TSLiteralType > ${literalAttributeMatcher}`,
},
];
}

export default defineConfig(
globalIgnores([
"**/*.snap",
Expand Down Expand Up @@ -47,6 +76,7 @@ export default defineConfig(
},
},
rules: {
"@typescript-eslint/no-import-type-side-effects": "error",
"@typescript-eslint/no-unnecessary-condition": [
"error",
{ allowConstantLoopConditions: true },
Expand All @@ -73,6 +103,24 @@ export default defineConfig(

// https://github.com/eslint-community/eslint-plugin-n/issues/472
"n/no-unpublished-bin": "off",

"no-restricted-syntax": ["error", ...banJsImportExtension()],

"perfectionist/sort-imports": [
"error",
{
alphabet: importAlphabet,
groups: [
"side-effect",
["builtin", "external"],
["parent", "sibling", "index", "subpath"],
"unknown",
],

partitionByNewLine: false,
type: "custom",
},
],
},
settings: {
n: {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"type": "module",
"scripts": {
"build": "tsdown",
"flint": "node packages/flint/bin/index.js",
"flint": "node --conditions='@flint.fyi/source' packages/flint/bin/index.js",
"lint": "eslint . --max-warnings 0",
"lint:knip": "knip",
"lint:packages": "pnpm dedupe --check",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/formatting/runPrettier.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {
import type {
FormattingResults,
LintResultsMaybeWithChanges,
} from "@flint.fyi/core";
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { runCli } from "./runCli.js";
export { runCli } from "./runCli.ts";
2 changes: 1 addition & 1 deletion packages/cli/src/options.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { parseArgs, ParseArgsOptionsConfig } from "node:util";
import type { parseArgs, ParseArgsOptionsConfig } from "node:util";

export const options = {
"cache-ignore": {
Expand Down
8 changes: 4 additions & 4 deletions packages/cli/src/presenters/briefPresenterFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { makeAbsolute } from "@flint.fyi/utils";
import { styleText } from "node:util";
import { textTable } from "text-table-fast";

import { presentHeader } from "./shared/header.js";
import { presentDiagnostics } from "./shared/presentDiagnostics.js";
import { presentSummary } from "./shared/summary.js";
import { PresenterFactory } from "./types.js";
import { presentHeader } from "./shared/header.ts";
import { presentDiagnostics } from "./shared/presentDiagnostics.ts";
import { presentSummary } from "./shared/summary.ts";
import type { PresenterFactory } from "./types.ts";

export const briefPresenterFactory: PresenterFactory = {
about: {
Expand Down
28 changes: 14 additions & 14 deletions packages/cli/src/presenters/detailed/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ import chalk from "chalk";

export const indenter = chalk.gray("│ ");

export enum ColorCodes {
codeLineNumbers = "#bbb",
codeWarningUnderline = "#fcc",
defaultSuggestionColor = "#bbccdd",
filePath = "#ff4949",
filePathPrefix = "#ff7777",
primaryMessage = "#eeaa77",
reportAboutId = "#ff9999",
ruleBracket = "#ccaaaa",
ruleUrl = "#aaccaa",
secondaryMessage = "#ccbbaa",
suggestionMessage = "#99aacc",
suggestionTextHighlight = "#bbeeff",
}
export const ColorCodes = {
codeLineNumbers: "#bbb",
codeWarningUnderline: "#fcc",
defaultSuggestionColor: "#bbccdd",
filePath: "#ff4949",
filePathPrefix: "#ff7777",
primaryMessage: "#eeaa77",
reportAboutId: "#ff9999",
ruleBracket: "#ccaaaa",
ruleUrl: "#aaccaa",
secondaryMessage: "#ccbbaa",
suggestionMessage: "#99aacc",
suggestionTextHighlight: "#bbeeff",
} as const;
10 changes: 5 additions & 5 deletions packages/cli/src/presenters/detailed/createDetailedReport.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { FileReport } from "@flint.fyi/core";
import type { FileReport } from "@flint.fyi/core";
import chalk from "chalk";

import { ColorCodes, indenter } from "./constants.js";
import { formatCode } from "./formatCode.js";
import { formatSuggestion } from "./formatSuggestion.js";
import { wrapIfNeeded } from "./wrapIfNeeded.js";
import { ColorCodes, indenter } from "./constants.ts";
import { formatCode } from "./formatCode.ts";
import { formatSuggestion } from "./formatSuggestion.ts";
import { wrapIfNeeded } from "./wrapIfNeeded.ts";

export async function* createDetailedReport(
report: FileReport,
Expand Down
14 changes: 7 additions & 7 deletions packages/cli/src/presenters/detailed/detailedPresenterFactory.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { hasFix } from "@flint.fyi/core";
import chalk from "chalk";

import { presentHeader } from "../shared/header.js";
import { presentDiagnostics } from "../shared/presentDiagnostics.js";
import { presentSummary } from "../shared/summary.js";
import { PresenterFactory } from "../types.js";
import { ColorCodes, indenter } from "./constants.js";
import { createDetailedReport } from "./createDetailedReport.js";
import { wrapIfNeeded } from "./wrapIfNeeded.js";
import { presentHeader } from "../shared/header.ts";
import { presentDiagnostics } from "../shared/presentDiagnostics.ts";
import { presentSummary } from "../shared/summary.ts";
import type { PresenterFactory } from "../types.ts";
import { ColorCodes, indenter } from "./constants.ts";
import { createDetailedReport } from "./createDetailedReport.ts";
import { wrapIfNeeded } from "./wrapIfNeeded.ts";

export const detailedPresenterFactory: PresenterFactory = {
about: {
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/presenters/detailed/formatCode.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { FileReport } from "@flint.fyi/core";
import type { FileReport } from "@flint.fyi/core";
import * as shikiCli from "@shikijs/cli";
import chalk from "chalk";
import { styleText } from "node:util";

import { ColorCodes, indenter } from "./constants.js";
import { ColorCodes, indenter } from "./constants.ts";

// TODO: make reactive
const leftWidth = 7;
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/presenters/detailed/formatSuggestion.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import chalk from "chalk";

import { ColorCodes } from "./constants.js";
import { ColorCodes } from "./constants.ts";

export function formatSuggestion(suggestion: string) {
return [
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/presenters/detailed/wrapIfNeeded.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ChalkInstance } from "chalk";
import type { ChalkInstance } from "chalk";
import wrapAnsi from "wrap-ansi";

import { indenter } from "./constants.js";
import { indenter } from "./constants.ts";

export function wrapIfNeeded(
lineFormat: ChalkInstance,
Expand Down
8 changes: 4 additions & 4 deletions packages/cli/src/presenters/getPresenterFactory.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { OptionsValues } from "../options.js";
import { briefPresenterFactory } from "./briefPresenterFactory.js";
import { detailedPresenterFactory } from "./detailed/detailedPresenterFactory.js";
import { PresenterFactory } from "./types.js";
import type { OptionsValues } from "../options.ts";
import { briefPresenterFactory } from "./briefPresenterFactory.ts";
import { detailedPresenterFactory } from "./detailed/detailedPresenterFactory.ts";
import type { PresenterFactory } from "./types.ts";

export function getPresenterFactory(
values: Pick<OptionsValues, "interactive" | "presenter">,
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/presenters/shared/header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { cacheFilePath } from "@flint.fyi/core";
import chalk from "chalk";
import fs from "node:fs";

import { PresenterInitializeContext } from "../types.js";
import type { PresenterInitializeContext } from "../types.ts";

export function* presentHeader({
configFileName,
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/presenters/shared/presentDiagnostics.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { FileResults } from "@flint.fyi/core";
import type { FileResults } from "@flint.fyi/core";
import { styleText } from "node:util";

import { pluralize } from "../pluralize.js";
import { pluralize } from "../pluralize.ts";

export function* presentDiagnostics(filesResults: Map<string, FileResults>) {
const diagnostics = Array.from(filesResults.values()).flatMap(
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/presenters/shared/summary.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { styleText } from "node:util";

import { pluralize } from "../pluralize.js";
import { PresenterSummarizeContext } from "../types.js";
import { pluralize } from "../pluralize.ts";
import type { PresenterSummarizeContext } from "../types.ts";

export interface SummaryCounts {
all: number;
Expand Down
8 changes: 4 additions & 4 deletions packages/cli/src/renderers/createRendererFactory.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { OptionsValues } from "../options.js";
import { getPresenterFactory } from "../presenters/getPresenterFactory.js";
import { interactiveRendererFactory } from "./interactive/interactiveRendererFactory.js";
import { singleRendererFactory } from "./singleRendererFactory.js";
import type { OptionsValues } from "../options.ts";
import { getPresenterFactory } from "../presenters/getPresenterFactory.ts";
import { interactiveRendererFactory } from "./interactive/interactiveRendererFactory.ts";
import { singleRendererFactory } from "./singleRendererFactory.ts";

export function createRendererFactory(
configFileName: string,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import cliCursor from "cli-cursor";
import readline from "node:readline";

import { RendererContext, RendererFactory } from "../types.js";
import { createListeners } from "./createListeners.js";
import { createState } from "./createState.js";
import { printAllClear } from "./printAllClear.js";
import { printControls } from "./printControls.js";
import { printFile } from "./printFile.js";
import { printHeader } from "./printHeader.js";
import { printSummary } from "./printSummary.js";
import type { RendererContext, RendererFactory } from "../types.ts";
import { createListeners } from "./createListeners.ts";
import { createState } from "./createState.ts";
import { printAllClear } from "./printAllClear.ts";
import { printControls } from "./printControls.ts";
import { printFile } from "./printFile.ts";
import { printHeader } from "./printHeader.ts";
import { printSummary } from "./printSummary.ts";

export const interactiveRendererFactory: RendererFactory = {
about: {
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/renderers/interactive/printFile.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { FileReport } from "@flint.fyi/core";
import type { FileReport } from "@flint.fyi/core";
import * as fs from "node:fs";

import { Presenter } from "../../presenters/types.js";
import type { Presenter } from "../../presenters/types.ts";

export async function printFile(
filePath: string,
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/renderers/interactive/printSummary.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { FileResults, hasFix } from "@flint.fyi/core";
import { type FileResults, hasFix } from "@flint.fyi/core";
import { styleText } from "node:util";

import { pluralize } from "../../presenters/pluralize.js";
import { pluralize } from "../../presenters/pluralize.ts";

export function printSummary(filesWithReportResults: [string, FileResults][]) {
const counts = {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/renderers/singleRendererFactory.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as fs from "node:fs/promises";

import { RendererFactory } from "./types.js";
import type { RendererFactory } from "./types.ts";

export const singleRendererFactory: RendererFactory = {
about: {
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/renderers/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FormattingResults, LintResults } from "@flint.fyi/core";
import type { FormattingResults, LintResults } from "@flint.fyi/core";

import { Presenter } from "../presenters/types.js";
import type { Presenter } from "../presenters/types.ts";

export interface Renderer {
announce(): void;
Expand Down
10 changes: 5 additions & 5 deletions packages/cli/src/runCli.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { parseArgs } from "node:util";

import packageData from "../package.json" with { type: "json" };
import { findConfigFileName } from "./findConfigFileName.js";
import { options } from "./options.js";
import { createRendererFactory } from "./renderers/createRendererFactory.js";
import { runCliOnce } from "./runCliOnce.js";
import { runCliWatch } from "./runCliWatch.js";
import { findConfigFileName } from "./findConfigFileName.ts";
import { options } from "./options.ts";
import { createRendererFactory } from "./renderers/createRendererFactory.ts";
import { runCliOnce } from "./runCliOnce.ts";
import { runCliWatch } from "./runCliWatch.ts";

export async function runCli(args: string[]) {
const { values } = parseArgs({
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/src/runCliOnce.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { debugForFile } from "debug-for-file";
import path from "node:path";
import { pathToFileURL } from "node:url";

import { runPrettier } from "./formatting/runPrettier.js";
import { OptionsValues } from "./options.js";
import { Renderer } from "./renderers/types.js";
import { runPrettier } from "./formatting/runPrettier.ts";
import type { OptionsValues } from "./options.ts";
import type { Renderer } from "./renderers/types.ts";

const log = debugForFile(import.meta.filename);

Expand Down
6 changes: 3 additions & 3 deletions packages/cli/src/runCliWatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import debounce from "debounce";
import { debugForFile } from "debug-for-file";
import * as fs from "node:fs";

import { OptionsValues } from "./options.js";
import { Renderer } from "./renderers/types.js";
import { runCliOnce } from "./runCliOnce.js";
import type { OptionsValues } from "./options.ts";
import type { Renderer } from "./renderers/types.ts";
import { runCliOnce } from "./runCliOnce.ts";

const log = debugForFile(import.meta.filename);

Expand Down
8 changes: 4 additions & 4 deletions packages/core/src/cache/readFromCache.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { CachedFactory } from "cached-factory";
import { debugForFile } from "debug-for-file";

import { readFileSafeAsJson } from "../running/readFileSafeAsJson.js";
import { CacheStorage } from "../types/cache.js";
import { cacheFilePath } from "./constants.js";
import { getFileTouchTime } from "./getFileTouchTime.js";
import { readFileSafeAsJson } from "../running/readFileSafeAsJson.ts";
import type { CacheStorage } from "../types/cache.ts";
import { cacheFilePath } from "./constants.ts";
import { getFileTouchTime } from "./getFileTouchTime.ts";

const log = debugForFile(import.meta.filename);

Expand Down
Loading