From 644df12ff5ab037911cb0db4593d5b8a1b1d1d2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Thu, 7 Sep 2023 01:33:28 +0200 Subject: Normalize tsconfig formatting. --- static/.gitignore | 1 + static/prettify-tsconfig.js | 15 ++++++++ static/tsconfig.json | 85 +++++++++++++++++++++------------------------ 3 files changed, 56 insertions(+), 45 deletions(-) create mode 100755 static/prettify-tsconfig.js diff --git a/static/.gitignore b/static/.gitignore index cbdca98d..712e640c 100644 --- a/static/.gitignore +++ b/static/.gitignore @@ -6,3 +6,4 @@ deps.svg !arbitary_kv.js !input_list.js docs/ +!prettify-tsconfig.js diff --git a/static/prettify-tsconfig.js b/static/prettify-tsconfig.js new file mode 100755 index 00000000..a2bef6f0 --- /dev/null +++ b/static/prettify-tsconfig.js @@ -0,0 +1,15 @@ +#!/usr/bin/env node + +/* + * Script to normalize tsconfig.json. + */ + +const { parse, stringify, assign } = require('comment-json') +const fs = require('fs') + +const filename = 'tsconfig.json' + +const obj = parse(fs.readFileSync(filename).toString()) +const output = stringify(obj, null, 4) + +fs.writeFileSync(filename, output) diff --git a/static/tsconfig.json b/static/tsconfig.json index c421a586..02d475f3 100644 --- a/static/tsconfig.json +++ b/static/tsconfig.json @@ -1,46 +1,41 @@ { - "compilerOptions": { - /* Visit https://aka.ms/tsconfig.json to read more about this file */ - - /* Projects */ - - /* Language and Environment */ - "target": "es2017", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ - - /* Modules */ - "module": "CommonJS", /* Specify what module code is generated. */ - - /* JavaScript Support */ - "allowJs": false, /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */ - - /* Emit */ - // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ - // "declarationMap": true, /* Create sourcemaps for d.ts files. */ - // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ - "sourceMap": true, /* Create source map files for emitted JavaScript files. */ - "newLine": "lf", /* Set the newline character for emitting files. */ - "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ - - /* 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. */ - }, - "include": ["**/*"], - "exclude": ["node_modules", "**/*.spec.ts"], - "typedocOptions": { - "entryPointStrategy": "expand", - "entryPoints": ["./ts"], - "exclude": ["node_modules"], - "plugin": [ - "@mxssfd/typedoc-theme" - ], - "theme": "my-theme", - "out": "docs" - } -} + "compilerOptions": { + /* Visit https://aka.ms/tsconfig.json to read more about this file */ + /* Projects */ + /* Language and Environment */ + "target": "es2017", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. *//* Modules */ + "module": "CommonJS", /* Specify what module code is generated. *//* JavaScript Support */ + "allowJs": false, /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. *//* Emit */ + // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ + // "declarationMap": true, /* Create sourcemaps for d.ts files. */ + // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ + "sourceMap": true, /* Create source map files for emitted JavaScript files. */ + "newLine": "lf", /* Set the newline character for emitting files. */ + "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. *//* 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. */ + }, + "include": [ + "**/*" + ], + "exclude": [ + "node_modules", + "**/*.spec.ts" + ], + "typedocOptions": { + "entryPointStrategy": "expand", + "entryPoints": [ + "./ts" + ], + "exclude": [ + "node_modules" + ], + "plugin": [ + "@mxssfd/typedoc-theme" + ], + "theme": "my-theme", + "out": "docs" + } +} \ No newline at end of file -- cgit v1.2.3