npm(prettier-config): add tsconfig to jsonc

Summary:
`tsconfig.json` has comments, so it is jsonc.

Cf. https://aka.ms/tsconfig.json

Also add tsconfig.json in rootdir and update arclint to ignore
`tsconfig.json`.

Signed-off-by: Yongmin Hong <revi@omglol.email>

Test Plan: Try prettier checks on `tsconfig.json` after merging.

Reviewers: O1 revi & automations, revi

Reviewed By: O1 revi & automations, revi

Differential Revision: https://issuetracker.revi.xyz/D376
This commit is contained in:
revi 2024-06-20 14:29:13 +09:00
parent 122113d958
commit b189fe62aa
Signed by: revi
GPG key ID: 1EB4F6CEEA100E94
5 changed files with 63 additions and 6 deletions

View file

@ -19,7 +19,7 @@
"json": {
"type": "json",
"include": ["(^\\.arcconfig$)", "(^\\.arclint$)", "(\\.json$)"],
"exclude": ["(^.vscode/*.json$)"]
"exclude": ["(^.vscode/*.json$)", "(^tsconfig.json$)"]
},
"merge-conflict": {
"type": "merge-conflict"
@ -57,7 +57,7 @@
},
"text-php": {
"type": "text",
"exclude": ["(\\.php)"],
"include": ["(\\.php)"],
"text.max-line-length": 80,
"severity": {
"1": "autofix",

View file

@ -47,7 +47,14 @@ ## Config
options: {parser: 'json'},
},
{
files: ['.vscode/*.json', '**.hujson'],
files: [
'.vscode/*.json',
'**.hujson',
'jsconfig.json',
'jsconfig.*.json',
'tsconfig.json',
'tsconfig.*.json',
],
options: {parser: 'jsonc', trailingComma: 'none'},
},
{

View file

@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/package.json",
"name": "@revi/prettier-config",
"version": "0.0.4",
"version": "0.0.5",
"author": {
"name": "revi",
"email": "revi@omglol.email",
@ -24,7 +24,8 @@
"directory": "npm/prettier-config"
},
"bugs": {
"url": "https://revi.xyz/new"
"url": "https://revi.xyz/new",
"email": "bugs@phab.revi.dev"
},
"keywords": [
"prettier"

View file

@ -47,7 +47,14 @@ const config = {
options: {parser: 'json'},
},
{
files: ['.vscode/*.json', '**.hujson'],
files: [
'.vscode/*.json',
'**.hujson',
'jsconfig.json',
'jsconfig.*.json',
'tsconfig.json',
'tsconfig.*.json',
],
options: {parser: 'jsonc', trailingComma: 'none'},
},
{

42
tsconfig.json Normal file
View file

@ -0,0 +1,42 @@
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig to read more about this file */
/* Language and Environment */
"target": "esnext",
/* Set the JavaScript language version for emitted JavaScript
and include compatible library declarations. */
/* Modules */
"module": "NodeNext",
/* Specify what module code is generated. */
"moduleResolution": "NodeNext",
/* Specify how TypeScript looks up a file from a given module specifier. */
//"rootDir": "./",
/* Specify the root folder within your source files. */
//"baseUrl": "./",
/* Specify the base directory to resolve non-relative module names. */
/* JavaScript Support */
"allowJs": true,
/* Allow JavaScript files to be a part of your program.
Use the 'checkJS' option to get errors from these files. */
"checkJs": true,
/* Enable error reporting in type-checked JavaScript files. */
/* Interop Constraints */
"esModuleInterop": true,
/* Emit additional JavaScript to ease support for importing CommonJS modules.
This enables 'allowSyntheticDefaultImports' for type compatibility. */
"forceConsistentCasingInFileNames": true,
/* Ensure that casing is correct in imports. */
/* Type Checking */
"strict": true,
/* Enable all strict type-checking options. */
/* Completeness */
"skipLibCheck": true
/* Skip type checking all .d.ts files. */
}
}