Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support JSONC for tsconfig.json #42

Closed
timbrinded opened this issue Jun 5, 2024 · 2 comments
Closed

Support JSONC for tsconfig.json #42

timbrinded opened this issue Jun 5, 2024 · 2 comments

Comments

@timbrinded
Copy link

Just starting off with borp, and the first thing i've seen is that it has issues with typical tsconfig files.

1. Doesn't support comments

{
	"compilerOptions": {
		"incremental": true,

		// Enable latest features
		"lib": ["ESNext", "ESNext.Disposable"],
		"target": "ESNext",


		// Bundler mode
		"moduleResolution": "bundler",
		"allowImportingTsExtensions": true,

		// Some stricter flags
		"noUnusedLocals": true,
		"noUnusedParameters": true,
		"noPropertyAccessFromIndexSignature": true,

		"downlevelIteration": true // Ensure async iteration is supported
	}
}

gives error:

❯ pnpm borp
SyntaxError: Expected double-quoted property name in JSON at position 50 (line 5 column 3)
    at JSON.parse (<anonymous>)
    at runWithTypeScript (file:///home/timbo/workspace/repo/node_modules/.pnpm/borp@0.14.0/node_modules/borp/lib/run.js:59:27)
    at async file:///home/timbo/workspace/repo/node_modules/.pnpm/borp@0.14.0/node_modules/borp/borp.js:126:18

2. Doesn't support extends

{
	"extends": "../tsconfig.json",
}

gives error:

❯ pnpm borp
SyntaxError: Expected double-quoted property name in JSON at position 34 (line 3 column 1)
    at JSON.parse (<anonymous>)
    at runWithTypeScript (file:///home/timbo/workspace/repo/node_modules/.pnpm/borp@0.14.0/node_modules/borp/lib/run.js:59:27)
    at async file:///home/timbo/workspace/repo/node_modules/.pnpm/borp@0.14.0/node_modules/borp/borp.js:126:18
@mcollina
Copy link
Owner

mcollina commented Jun 7, 2024

Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests.

@niktekusho
Copy link

I think this issue should be closed since #63 got merged 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants