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
1 change: 0 additions & 1 deletion configs/eslint-config-custom/eslint.config.typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export function eslintConfig(userConfigs = []) {
{
languageOptions: {
parserOptions: {
project: ["tsconfig.json"],
tsconfigRootDir: cwd(),
projectService: true,

Expand Down
12 changes: 6 additions & 6 deletions configs/eslint-config-custom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@
}
},
"devDependencies": {
"@eslint/js": "^9.38.0",
"@types/node": "^25.0.5",
"@typescript-eslint/parser": "^8.46.2",
"eslint": "^9.38.0",
"@eslint/js": "^9.39.2",
"@types/node": "^25.0.6",
"@typescript-eslint/parser": "^8.52.0",
"eslint": "^9.39.2",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-prettier": "^5.5.4",
"eslint-plugin-yml": "^1.19.0",
"eslint-plugin-yml": "^1.19.1",
"globals": "^17.0.0",
"prettier": "^3.7.4",
"prettier-config-custom": "workspace:^",
"typescript": "^5.9.3",
"typescript-eslint": "^8.46.2",
"typescript-eslint": "^8.52.0",
"yaml-eslint-parser": "^1.3.2"
},
"prettier": "prettier-config-custom"
Expand Down
4 changes: 2 additions & 2 deletions configs/vite-config-custom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
"vite-config-builder": "^0.1.1",
"vite-plugin-dts-build": "^0.2.2",
"vite-plugin-externalize-deps": "^0.10.0",
"vite-tsconfig-paths": "^5.1.4"
"vite-tsconfig-paths": "^6.0.4"
},
"dependencies": {
"typescript": "^5.9.3",
"vite": "^7.1.12"
"vite": "^7.3.1"
}
}
8 changes: 7 additions & 1 deletion configs/vite-config-custom/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { resolve, join } from "node:path";
import { existsSync } from "node:fs";
import { cwd, env } from "node:process";

import { initConfigBuilder, ViteEnv, PluginBuilder } from "vite-config-builder";
Expand Down Expand Up @@ -161,7 +162,12 @@ function initCommonBuilder(viteConfigEnv: ConfigEnv) {
});
}

const plugins = new PluginBuilder([tsconfigPaths()]);
const tsconfigPath = resolve(cwd(), "tsconfig.lib.json");
const plugins = new PluginBuilder([
tsconfigPaths({
projects: existsSync(tsconfigPath) ? [tsconfigPath] : undefined
})
]);
Comment on lines +165 to +170
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

vite-tsconfig-paths version 6.0.4 projects option API documentation

💡 Result:

In vite-tsconfig-paths v6.0.4, the plugin options include:

  • projects: string[]: Use this only for “esoteric” setups to explicitly point the plugin at your tsconfig files. Each entry is relative to the root option. If projects is set, the plugin will not search the root directory for tsconfig files (the docs recommend trying root alone first because projects is more brittle). [1]
  • Related behavior: the default for root depends on whether projects is defined—if it is, root defaults to the Vite project root; otherwise it defaults to Vite’s searchForWorkspaceRoot. [1]

Example:

import tsconfigPaths from 'vite-tsconfig-paths'

export default {
  plugins: [
    tsconfigPaths({
      root: '.',
      projects: ['apps/web/tsconfig.json', 'packages/shared'],
    }),
  ],
}

Sources:
[1] vite-tsconfig-paths v6.0.4 README (UNPKG) (app.unpkg.com)

Citations:


🏁 Script executed:

# Find and examine the file in question
fd -t f "index.ts" configs/vite-config-custom/src/ | head -5

Repository: mincho-js/mincho

Length of output: 99


🏁 Script executed:

cat -n configs/vite-config-custom/src/index.ts | sed -n '155,180p'

Repository: mincho-js/mincho

Length of output: 703


🏁 Script executed:

# Also check what PluginBuilder is and how it's used
cat -n configs/vite-config-custom/src/index.ts | sed -n '1,50p'

Repository: mincho-js/mincho

Length of output: 2059


Use a relative path for the projects option or reconsider using it.

The projects option in vite-tsconfig-paths v6.0.4 expects paths relative to the root option, but the code passes an absolute path via resolve(cwd(), "tsconfig.lib.json"). This will not work. Either:

  1. Pass a relative path: projects: existsSync(tsconfigPath) ? ["tsconfig.lib.json"] : undefined
  2. Or omit projects entirely and rely on the plugin's auto-discovery via the root option (the documentation recommends this approach as projects is "more brittle").
🤖 Prompt for AI Agents
In `@configs/vite-config-custom/src/index.ts` around lines 165 - 170, The projects
option is being passed an absolute path (tsconfigPath built with resolve(cwd(),
"tsconfig.lib.json")), which breaks vite-tsconfig-paths v6; update the
tsconfigPaths invocation in PluginBuilder so it either supplies a relative
project path (e.g., "tsconfig.lib.json" when existsSync(tsconfigPath) is true)
or remove the projects property entirely and let the plugin auto-discover via
the root option; adjust the tsconfigPaths(...) call around the tsconfigPath /
existsSync check to implement one of these two fixes.


return {
configs,
Expand Down
43 changes: 21 additions & 22 deletions examples/react-babel/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@
import { resolve } from "node:path";
import { cwd } from "node:process";
import globals from 'globals'
import globals from "globals";
import { defineConfig } from "eslint/config";
import eslint from '@eslint/js'
import tseslint from 'typescript-eslint'
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
import tsParser from "@typescript-eslint/parser";
import reactRefreshPlugin from 'eslint-plugin-react-refresh'
import reactHooksPlugin from 'eslint-plugin-react-hooks'
import reactRefreshPlugin from "eslint-plugin-react-refresh";
import reactHooksPlugin from "eslint-plugin-react-hooks";

const PACKAGE_ROOT = resolve(cwd());

export default defineConfig(
eslint.configs.recommended,
...tseslint.configs.recommended,
eslint.configs.recommended,
...tseslint.configs.recommended,
reactHooksPlugin.configs.flat.recommended,
{
languageOptions: {
parserOptions: {
tsconfigRootDir: PACKAGE_ROOT,
projectService: true,
},
},
}
}
Comment on lines 18 to +23
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# First, look at the full eslint.config.js file to understand context
cat -n examples/react-babel/eslint.config.js

Repository: mincho-js/mincho

Length of output: 1897


🏁 Script executed:

# Check what PACKAGE_ROOT is set to
grep -n "PACKAGE_ROOT" examples/react-babel/eslint.config.js

Repository: mincho-js/mincho

Length of output: 141


🏁 Script executed:

# Check if there's a tsconfig.json in examples/react-babel
find examples/react-babel -name "tsconfig*.json" -type f

Repository: mincho-js/mincho

Length of output: 173


🏁 Script executed:

# Check the directory structure
tree -L 3 examples/react-babel/ 2>/dev/null || find examples/react-babel -type f -name "*.json" | head -20

Repository: mincho-js/mincho

Length of output: 335


🏁 Script executed:

# Check if there's a tsconfig at the root or in examples
find . -maxdepth 3 -name "tsconfig*.json" -type f | grep -E "(^./tsconfig|./examples/)"

Repository: mincho-js/mincho

Length of output: 330


🏁 Script executed:

# Check git history to see if `project` was explicitly removed
git log -p --all -- examples/react-babel/eslint.config.js | grep -A 20 -B 5 "project" | head -60

Repository: mincho-js/mincho

Length of output: 42


🏁 Script executed:

# Check if there are any tests that validate the eslint config behavior
find . -type f -name "*.test.*" -o -name "*.spec.*" | xargs grep -l "eslint" 2>/dev/null | head -5

Repository: mincho-js/mincho

Length of output: 42


🏁 Script executed:

# Check one of the tsconfig files in react-babel to understand the setup
cat examples/react-babel/tsconfig.json

Repository: mincho-js/mincho

Length of output: 403


🏁 Script executed:

# Check typescript-eslint documentation or examples about projectService with tsconfigRootDir
# Also check if global parserOptions without parser is a valid pattern in flat config
rg -A 5 "projectService.*true" . --type js --type json | head -40

Repository: mincho-js/mincho

Length of output: 2032


🏁 Script executed:

# Look at the actual change/commit to understand intent
git log --oneline examples/react-babel/eslint.config.js | head -5

Repository: mincho-js/mincho

Length of output: 86


🏁 Script executed:

# Check if this config file has been recently added or heavily modified
git log --all --stat examples/react-babel/eslint.config.js | head -20

Repository: mincho-js/mincho

Length of output: 720


🏁 Script executed:

# Get the full diff of the recent change to see what was actually modified
git show d245af3 examples/react-babel/eslint.config.js | head -100

Repository: mincho-js/mincho

Length of output: 1917


🏁 Script executed:

# Look at previous versions to understand what changed
git show 26546b1:examples/react-babel/eslint.config.js 2>/dev/null | head -60

Repository: mincho-js/mincho

Length of output: 1539


Verify projectService correctly resolves tsconfig.json after removing explicit project array.

The change removed project: ["tsconfig.json"] and now relies on projectService auto-discovery. With tsconfigRootDir: cwd() and projectService: true, the parser should find examples/react-babel/tsconfig.json via upward search; however, confirm this is picking the intended config and not the root-level tsconfig.json.

🤖 Prompt for AI Agents
In `@examples/react-babel/eslint.config.js` around lines 18 - 23, You removed the
explicit project: ["tsconfig.json"] and now rely on
languageOptions.parserOptions.tsconfigRootDir and projectService to
auto-discover the tsconfig, which can pick up the workspace root tsconfig
instead of examples/react-babel/tsconfig.json; either restore an explicit
project entry (e.g., set languageOptions.parserOptions.project to
["tsconfig.json"] or to the absolute path resolved from PACKAGE_ROOT) to pin the
intended config, or keep projectService and add a verification step (run ESLint
in that package or print resolved parser config) to confirm the parser resolves
PACKAGE_ROOT/tsconfig.json; update the languageOptions.parserOptions block
(symbols: languageOptions, parserOptions, tsconfigRootDir, projectService,
project) accordingly.

},
{
files: ['**/*.{ts,tsx}'],
files: ["**/*.{ts,tsx}"],
languageOptions: {
parser: tsParser,
parserOptions: {
project: ["tsconfig.json"],
tsconfigRootDir: cwd(),
projectService: true,

Expand All @@ -37,22 +36,22 @@ export default defineConfig(
}
},
plugins: {
'react-hooks': reactHooksPlugin,
'react-refresh': reactRefreshPlugin,
"react-hooks": reactHooksPlugin,
"react-refresh": reactRefreshPlugin
},
rules: {
...reactHooksPlugin.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true }
]
}
},
{
files: ["*.js", "*.cjs", "*.mjs"],
extends: [tseslint.configs.disableTypeChecked],
extends: [tseslint.configs.disableTypeChecked]
},
{
ignores: ["dist/**"],
},
)
ignores: ["dist/**"]
}
);
14 changes: 7 additions & 7 deletions examples/react-babel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,20 @@
"scheduler": "^0.27.0"
},
"devDependencies": {
"@eslint/js": "^9.38.0",
"@eslint/js": "^9.39.2",
"@types/babel__core": "^7.20.5",
"@types/cssesc": "^3.0.2",
"@types/react": "^19.2.8",
"@types/react-dom": "^19.2.3",
"@types/scheduler": "^0.26.0",
"@typescript-eslint/parser": "^8.46.2",
"@typescript-eslint/parser": "^8.52.0",
"@vitejs/plugin-react": "^5.1.2",
"eslint": "^9.38.0",
"eslint-plugin-react-hooks": "^7.0.0",
"eslint-plugin-react-refresh": "^0.4.24",
"eslint": "^9.39.2",
"eslint-plugin-react-hooks": "^7.0.1",
"eslint-plugin-react-refresh": "^0.4.26",
"globals": "^17.0.0",
"typescript": "~5.9.3",
"typescript-eslint": "^8.46.2",
"vite": "^7.1.12"
"typescript-eslint": "^8.52.0",
"vite": "^7.3.1"
}
}
7 changes: 5 additions & 2 deletions examples/react-swc/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import reactRefreshPlugin from "eslint-plugin-react-refresh";
import reactHooksPlugin from "eslint-plugin-react-hooks";

const PACKAGE_ROOT = resolve(cwd());
const reactHooksPluginCompat = /** @type {import("eslint").ESLint.Plugin} */ (
reactHooksPlugin
);

export default defineConfig(
eslint.configs.recommended,
Expand Down Expand Up @@ -37,15 +40,15 @@ export default defineConfig(
},
plugins: {
"react-refresh": reactRefreshPlugin,
"react-hooks": reactHooksPlugin,
"react-hooks": reactHooksPluginCompat,
},
rules: {
...reactHooksPlugin.configs.recommended.rules,
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
}
},
},
{
files: ["*.js", "*.cjs", "*.mjs"],
Expand Down
16 changes: 8 additions & 8 deletions examples/react-swc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@
"react-dom": "^19.2.3"
},
"devDependencies": {
"@eslint/js": "^9.38.0",
"@eslint/js": "^9.39.2",
"@mincho-js/css": "workspace:^",
"@types/react": "^19.2.8",
"@types/react-dom": "^19.2.3",
"@typescript-eslint/eslint-plugin": "^8.46.2",
"@typescript-eslint/parser": "^8.46.2",
"@typescript-eslint/eslint-plugin": "^8.52.0",
"@typescript-eslint/parser": "^8.52.0",
"@vanilla-extract/css": "^1.17.4",
"@vanilla-extract/esbuild-plugin": "^2.3.21",
"@vanilla-extract/vite-plugin": "^5.1.4",
"@vitejs/plugin-react-swc": "^4.2.2",
"eslint": "^9.38.0",
"eslint-plugin-react-hooks": "^7.0.0",
"eslint-plugin-react-refresh": "^0.4.24",
"eslint": "^9.39.2",
"eslint-plugin-react-hooks": "^7.0.1",
"eslint-plugin-react-refresh": "^0.4.26",
"globals": "^17.0.0",
"typescript": "^5.9.3",
"typescript-eslint": "^8.46.2",
"vite": "^7.1.12"
"typescript-eslint": "^8.52.0",
"vite": "^7.3.1"
}
}
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@
"@mincho-js/debug-log": "workspace:^",
"@monorepo-utils/workspaces-to-typescript-project-references": "^2.11.0",
"@types/eslint": "^9.6.1",
"@types/node": "^25.0.5",
"@types/node": "^25.0.6",
"@typescript/analyze-trace": "^0.10.1",
"@vanilla-extract/vite-plugin": "^5.1.4",
"@vitest/coverage-v8": "^4.0.16",
"@yarnpkg/types": "^4.0.1",
"c8": "^10.1.3",
"eslint": "^9.38.0",
"eslint": "^9.39.2",
"eslint-config-custom": "workspace:^",
"prettier": "^3.7.4",
"prettier-config-custom": "workspace:^",
Expand All @@ -68,8 +68,8 @@
"tsconfig-custom": "workspace:^",
"turbo": "^2.7.3",
"typescript": "^5.9.3",
"vite": "^7.1.12",
"vite-node": "^3.2.4",
"vite": "^7.3.1",
"vite-node": "^5.2.0",
"vitest": "^4.0.16",
"yarn-constraints-rules": "^0.1.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
},
"devDependencies": {
"@types/babel__core": "^7.20.5",
"@types/node": "^25.0.5",
"@types/node": "^25.0.6",
"@vanilla-extract/css": "^1.17.4",
"@vanilla-extract/recipes": "^0.5.7",
"eslint-config-custom": "workspace:^",
Expand Down
Loading
Loading