From b189fe62aafc51be2febc182a1657462e11e26b4 Mon Sep 17 00:00:00 2001 From: Yongmin Hong Date: Thu, 20 Jun 2024 14:29:13 +0900 Subject: [PATCH] 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 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 --- .arclint | 4 +-- npm/prettier-config/README.md | 9 +++++- npm/prettier-config/package.json | 5 +-- npm/prettier-config/prettier.config.js | 9 +++++- tsconfig.json | 42 ++++++++++++++++++++++++++ 5 files changed, 63 insertions(+), 6 deletions(-) create mode 100644 tsconfig.json diff --git a/.arclint b/.arclint index 701db1a..6b25d51 100644 --- a/.arclint +++ b/.arclint @@ -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", diff --git a/npm/prettier-config/README.md b/npm/prettier-config/README.md index 52d883c..ae130d5 100644 --- a/npm/prettier-config/README.md +++ b/npm/prettier-config/README.md @@ -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'}, }, { diff --git a/npm/prettier-config/package.json b/npm/prettier-config/package.json index 0e70ef3..ec13c44 100644 --- a/npm/prettier-config/package.json +++ b/npm/prettier-config/package.json @@ -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" diff --git a/npm/prettier-config/prettier.config.js b/npm/prettier-config/prettier.config.js index f6e9138..49ddd00 100644 --- a/npm/prettier-config/prettier.config.js +++ b/npm/prettier-config/prettier.config.js @@ -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'}, }, { diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..040ff78 --- /dev/null +++ b/tsconfig.json @@ -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. */ + } +}