Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ peerDependencyRules:
> test ! -f eslint.config.mjs # check eslint config is removed
> test ! -f .prettierrc.json # check prettier config is removed
> cat vite.config.ts # check oxlint and oxfmt config merged into vite.config.ts
import { defineConfig } from 'vite-plus';
import { defineConfig } from "vite-plus";

export default defineConfig({
staged: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ peerDependencyRules:
vitest: '*'

> cat vite.config.ts # check oxfmt config merged into vite.config.ts with semi/singleQuote settings
import { defineConfig } from 'vite-plus';
import { defineConfig } from "vite-plus";

export default defineConfig({
staged: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Prettier config migrated to .oxfmtrc.json

> test ! -f .prettierrc.json # check prettier config is removed
> cat vite.config.ts # check oxfmt config merged into vite.config.ts
import { defineConfig } from 'vite-plus';
import { defineConfig } from "vite-plus";

export default defineConfig({
fmt: {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/snap-tests-global/migration-prettier/snap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ peerDependencyRules:

> test ! -f .prettierrc.json # check prettier config is removed
> cat vite.config.ts # check oxfmt config merged into vite.config.ts
import { defineConfig } from 'vite-plus';
import { defineConfig } from "vite-plus";
Comment thread
fengmk2 marked this conversation as resolved.

export default defineConfig({
staged: {
Expand Down
2 changes: 2 additions & 0 deletions packages/cli/snap-tests/bin-oxlint-wrapper/snap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ Output

Miscellaneous
--silent Do not display any diagnostics
--no-error-on-unmatched-pattern Do not exit with an error when no files are selected for
linting (for example, after applying ignore patterns)
--threads=INT Number of threads to use. Set to 1 for using only 1 CPU core.
--print-config This option outputs the configuration to be used. When present, no
linting is performed and only config-related options are valid.
Expand Down
3 changes: 2 additions & 1 deletion packages/cli/snap-tests/check-oxlint-env/snap.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[1]> OXLINT_TSGOLINT_PATH=./invalid-path vp lint --type-aware # should error that ./invalid-path doesn't exist
Failed to find tsgolint executable: OXLINT_TSGOLINT_PATH points to './invalid-path' which does not exist
No files found to lint. Please check your paths and ignore patterns.
Comment thread
fengmk2 marked this conversation as resolved.
Outdated
Finished in <variable>ms on 0 files with <variable> rules using <variable> threads.
Comment thread
fengmk2 marked this conversation as resolved.
Outdated
2 changes: 2 additions & 0 deletions packages/cli/snap-tests/command-helper/snap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ Output

Miscellaneous
--silent Do not display any diagnostics
--no-error-on-unmatched-pattern Do not exit with an error when no files are selected for
linting (for example, after applying ignore patterns)
--threads=INT Number of threads to use. Set to 1 for using only 1 CPU core.
--print-config This option outputs the configuration to be used. When present, no
linting is performed and only config-related options are valid.
Expand Down
2 changes: 2 additions & 0 deletions packages/cli/src/utils/json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import detectIndent from 'detect-indent';
import { detectNewline } from 'detect-newline';
import { parse as parseJsonc } from 'jsonc-parser';

// eslint-disable-next-line typescript-eslint/no-unnecessary-type-parameters -- convenience generic for callers
export function readJsonFile<T = Record<string, unknown>>(
file: string,
allowComments?: boolean,
Expand All @@ -13,6 +14,7 @@ export function readJsonFile<T = Record<string, unknown>>(
return parseFunction(content) as T;
}

// eslint-disable-next-line typescript-eslint/no-unnecessary-type-parameters -- convenience generic for callers
Comment thread
fengmk2 marked this conversation as resolved.
Outdated
export function writeJsonFile<T = Record<string, unknown>>(file: string, data: T) {
let newline = '\n';
let indent = ' ';
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/utils/package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export function detectPackageMetadata(
* @param currentDir - The current directory to start searching from.
* @returns The package.json content as a JSON object, or null if no package.json is found.
*/
// eslint-disable-next-line typescript-eslint/no-unnecessary-type-parameters -- convenience generic for callers
export function readNearestPackageJson<T = Record<string, unknown>>(currentDir: string): T | null {
do {
const packageJsonPath = path.join(currentDir, 'package.json');
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/utils/yaml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import fs from 'node:fs';

import { type Document, parseDocument, parse as parseYaml, Scalar } from 'yaml';

// eslint-disable-next-line typescript-eslint/no-unnecessary-type-parameters -- convenience generic for callers
export function readYamlFile<T = Record<string, unknown>>(file: string): T {
const content = fs.readFileSync(file, 'utf-8');
return parseYaml(content) as T;
Expand Down
6 changes: 3 additions & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@
},
"peerDependencies": {
"@arethetypeswrong/core": "^0.18.1",
"@tsdown/css": "0.21.7",
"@tsdown/exe": "0.21.7",
"@tsdown/css": "0.21.8",
"@tsdown/exe": "0.21.8",
"@types/node": "^20.19.0 || >=22.12.0",
"@vitejs/devtools": "^0.1.0",
"esbuild": "^0.27.0 || ^0.28.0",
Expand Down Expand Up @@ -219,6 +219,6 @@
"bundledVersions": {
"vite": "8.0.8",
"rolldown": "1.0.0-rc.15",
"tsdown": "0.21.7"
"tsdown": "0.21.8"
}
}
Loading
Loading