diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..7d20576 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,55 @@ +{ + "root": true, + "parser": "@typescript-eslint/parser", + "parserOptions": { + "project": ["./tsconfig.json"] + }, + "plugins": ["@typescript-eslint", "sonarjs", "filename-rules"], + "extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:sonarjs/recommended"], + "ignorePatterns": ["**/*.js"], + "rules": { + "filename-rules/match": [2, "/^(e2e\\.ts$|.*\\/e2e\\.ts$|[a-z0-9]+(?:[-._a-z0-9]+)*\\.ts|\\.[a-z0-9]+)$/"], + "prefer-arrow-callback": ["warn", { "allowNamedFunctions": true }], + "func-style": ["warn", "declaration", { "allowArrowFunctions": false }], + "@typescript-eslint/no-floating-promises": "error", + "@typescript-eslint/no-non-null-assertion": "error", + "constructor-super": "error", + "no-invalid-this": "off", + "@typescript-eslint/no-invalid-this": "error", + "no-restricted-syntax": ["error", "ForInStatement"], + "use-isnan": "error", + "no-unneeded-ternary": "error", + "no-nested-ternary": "error", + "@typescript-eslint/no-unused-vars": [ + "error", + { + "args": "after-used", + "ignoreRestSiblings": true, + "vars": "all", + "varsIgnorePattern": "^_", + "argsIgnorePattern": "^_" + } + ], + "@typescript-eslint/await-thenable": "error", + "@typescript-eslint/no-misused-new": "error", + "@typescript-eslint/restrict-plus-operands": "error", + "sonarjs/no-all-duplicated-branches": "error", + "sonarjs/no-collection-size-mischeck": "error", + "sonarjs/no-duplicated-branches": "error", + "sonarjs/no-element-overwrite": "error", + "sonarjs/no-identical-conditions": "error", + "sonarjs/no-identical-expressions": "error", + "@typescript-eslint/naming-convention": [ + "error", + { "selector": "interface", "format": ["StrictPascalCase"], "custom": { "regex": "^I[A-Z]", "match": false } }, + { "selector": "memberLike", "modifiers": ["private"], "format": ["strictCamelCase"], "leadingUnderscore": "require" }, + { "selector": "typeLike", "format": ["StrictPascalCase"] }, + { "selector": "typeParameter", "format": ["StrictPascalCase"], "prefix": ["T"] }, + { "selector": "variable", "format": ["strictCamelCase", "UPPER_CASE"], "leadingUnderscore": "allow", "trailingUnderscore": "allow" }, + { "selector": "variable", "modifiers": ["destructured"], "format": null }, + { "selector": "variable", "types": ["boolean"], "format": ["StrictPascalCase"], "prefix": ["is", "should", "has", "can", "did", "will", "does"] }, + { "selector": "variableLike", "format": ["strictCamelCase"] }, + { "selector": ["function", "variable"], "format": ["strictCamelCase"] } + ] + } +} diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ + diff --git a/.github/empty-string-checker.ts b/.github/empty-string-checker.ts new file mode 100644 index 0000000..ff94e81 --- /dev/null +++ b/.github/empty-string-checker.ts @@ -0,0 +1,129 @@ +import * as core from "@actions/core"; +import { Octokit } from "@octokit/rest"; +import simpleGit from "simple-git"; + +const token = process.env.GITHUB_TOKEN; +const [owner, repo] = process.env.GITHUB_REPOSITORY?.split("/") || []; +const pullNumber = process.env.GITHUB_PR_NUMBER || process.env.PULL_REQUEST_NUMBER || "0"; +const baseRef = process.env.GITHUB_BASE_REF; + +if (!token || !owner || !repo || pullNumber === "0" || !baseRef) { + core.setFailed("Missing required environment variables."); + process.exit(1); +} + +const octokit = new Octokit({ auth: token }); +const git = simpleGit(); + +async function main() { + try { + const { data: pullRequest } = await octokit.pulls.get({ + owner, + repo, + pull_number: parseInt(pullNumber, 10), + }); + + const baseSha = pullRequest.base.sha; + const headSha = pullRequest.head.sha; + + await git.fetch(["origin", baseSha, headSha]); + + const diff = await git.diff([`${baseSha}...${headSha}`]); + + core.info("Checking for empty strings..."); + const violations = parseDiffForEmptyStrings(diff); + + if (violations.length > 0) { + violations.forEach(({ file, line, content }) => { + core.warning( + "Detected an empty string.\n\nIf this is during variable initialization, consider using a different approach.\nFor more information, visit: https://www.github.com/ubiquity/ts-template/issues/31", + { + file, + startLine: line, + } + ); + }); + + // core.setFailed(`${violations.length} empty string${violations.length > 1 ? "s" : ""} detected in the code.`); + + await octokit.rest.checks.create({ + owner, + repo, + name: "Empty String Check", + head_sha: headSha, + status: "completed", + conclusion: violations.length > 0 ? "failure" : "success", + output: { + title: "Empty String Check Results", + summary: `Found ${violations.length} violation${violations.length !== 1 ? "s" : ""}`, + annotations: violations.map((v) => ({ + path: v.file, + start_line: v.line, + end_line: v.line, + annotation_level: "warning", + message: "Empty string found", + raw_details: v.content, + })), + }, + }); + } else { + core.info("No empty strings found."); + } + } catch (error) { + core.setFailed(`An error occurred: ${error instanceof Error ? error.message : String(error)}`); + } +} + +function parseDiffForEmptyStrings(diff: string) { + const violations: Array<{ file: string; line: number; content: string }> = []; + const diffLines = diff.split("\n"); + + let currentFile: string; + let headLine = 0; + let inHunk = false; + + diffLines.forEach((line) => { + const hunkHeaderMatch = /^@@ -\d+(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(line); + if (hunkHeaderMatch) { + headLine = parseInt(hunkHeaderMatch[1], 10); + inHunk = true; + return; + } + + if (line.startsWith("--- a/") || line.startsWith("+++ b/")) { + currentFile = line.slice(6); + inHunk = false; + return; + } + + // Only process TypeScript files + if (!currentFile?.endsWith(".ts")) { + return; + } + + if (inHunk && line.startsWith("+")) { + // Check for empty strings in TypeScript syntax + if (/^\+.*""/.test(line)) { + // Ignore empty strings in comments + if (!line.trim().startsWith("//") && !line.trim().startsWith("*")) { + // Ignore empty strings in template literals + if (!/`[^`]*\$\{[^}]*\}[^`]*`/.test(line)) { + violations.push({ + file: currentFile, + line: headLine, + content: line.substring(1).trim(), + }); + } + } + } + headLine++; + } else if (!line.startsWith("-")) { + headLine++; + } + }); + + return violations; +} +main().catch((error) => { + core.setFailed(`Error running empty string check: ${error instanceof Error ? error.message : String(error)}`); +}); diff --git a/.github/knip.ts b/.github/knip.ts new file mode 100644 index 0000000..c9f21e8 --- /dev/null +++ b/.github/knip.ts @@ -0,0 +1,13 @@ +import type { KnipConfig } from "knip"; + +const config: KnipConfig = { + entry: ["build/index.ts", ".github/empty-string-checker.ts"], + project: ["src/**/*.ts"], + ignore: ["src/types/config.ts", "**/__mocks__/**", "**/__fixtures__/**"], + ignoreExportsUsedInFile: true, + // eslint can also be safely ignored as per the docs: https://knip.dev/guides/handling-issues#eslint--jest + ignoreDependencies: ["eslint-config-prettier", "eslint-plugin-prettier", "@types/jest", "@mswjs/data"], + eslint: true, +}; + +export default config; diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..cde9843 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,6 @@ +Resolves # + + diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..28d7188 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,33 @@ +name: Build + +on: + push: + pull_request: + workflow_dispatch: + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-22.04 + + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 20.10.0 + + - name: Build + run: | + yarn + yarn build + + - name: Upload build artifact + uses: actions/upload-artifact@v4 + with: + name: static + path: static diff --git a/.github/workflows/conventional-commits.yml b/.github/workflows/conventional-commits.yml new file mode 100644 index 0000000..8d17568 --- /dev/null +++ b/.github/workflows/conventional-commits.yml @@ -0,0 +1,12 @@ +name: Conventional Commits + +on: + push: + +jobs: + conventional-commits: + name: Conventional Commits + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ubiquity/action-conventional-commits@master diff --git a/.github/workflows/cspell.yml b/.github/workflows/cspell.yml index 936bd68..c81c97a 100644 --- a/.github/workflows/cspell.yml +++ b/.github/workflows/cspell.yml @@ -1 +1,24 @@ -test modify \ No newline at end of file +name: Spell Check + +on: + push: + +jobs: + spellcheck: + name: Check for spelling errors + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: "20.10.0" + + - name: Install cspell + run: yarn add cspell + + - name: Run cspell + run: yarn format:cspell diff --git a/.github/workflows/cypress-testing.yml b/.github/workflows/cypress-testing.yml new file mode 100644 index 0000000..552e8f0 --- /dev/null +++ b/.github/workflows/cypress-testing.yml @@ -0,0 +1,37 @@ +name: Run Cypress testing suite +on: + workflow_dispatch: + workflow_run: + workflows: ["Build"] + types: + - completed + +jobs: + cypress-run: + runs-on: ubuntu-latest + steps: + - uses: actions/setup-node@v4 + with: + node-version: 20.10.0 + - name: Checkout + uses: actions/checkout@v4 + - name: Cypress run + uses: cypress-io/github-action@v6 + with: + build: yarn run build + start: yarn start + env: + CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/upload-artifact@v4 + if: failure() + with: + name: cypress-screenshots + path: cypress/screenshots + if-no-files-found: ignore + - uses: actions/upload-artifact@v4 + if: failure() + with: + name: cypress-videos + path: cypress/videos + if-no-files-found: ignore diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..3d6b9a8 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,28 @@ +name: Deploy to Cloudflare Pages + +on: + workflow_run: + workflows: ["Build"] + types: + - completed + +jobs: + deploy-to-cloudflare: + name: Automatic Cloudflare Deploy + runs-on: ubuntu-22.04 + steps: + - name: Deploy to Cloudflare + if: ${{ github.event.workflow_run.conclusion == 'success' }} + uses: ubiquity/cloudflare-deploy-action@main + with: + repository: ${{ github.repository }} + production_branch: ${{ github.event.repository.default_branch }} + build_artifact_name: "static" + output_directory: "static" + current_branch: ${{ github.event.workflow_run.head_branch }} + cloudflare_account_id: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + cloudflare_api_token: ${{ secrets.CLOUDFLARE_API_TOKEN }} + commit_sha: ${{ github.event.workflow_run.head_sha }} + workflow_run_id: ${{ github.event.workflow_run.id }} + app_id: ${{ secrets.APP_ID }} + app_private_key: ${{ secrets.APP_PRIVATE_KEY }} diff --git a/.github/workflows/jest-testing.yml b/.github/workflows/jest-testing.yml new file mode 100644 index 0000000..7f8747e --- /dev/null +++ b/.github/workflows/jest-testing.yml @@ -0,0 +1,27 @@ +name: Run Jest testing suite +on: + workflow_dispatch: + pull_request: + +env: + NODE_ENV: "test" + +jobs: + testing: + permissions: write-all + runs-on: ubuntu-latest + steps: + - uses: actions/setup-node@v4 + with: + node-version: "20.10.0" + + - uses: actions/checkout@master + with: + fetch-depth: 0 + + - name: Jest With Coverage + run: yarn install --immutable --immutable-cache --check-cache && yarn test + + - name: Add Jest Report to Summary + if: always() + run: echo "$(cat test-dashboard.md)" >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/knip-reporter.yml b/.github/workflows/knip-reporter.yml new file mode 100644 index 0000000..282c9a8 --- /dev/null +++ b/.github/workflows/knip-reporter.yml @@ -0,0 +1,38 @@ +name: Knip-reporter + +on: + workflow_run: + workflows: ["Knip"] + types: + - completed + +jobs: + knip-reporter: + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion != 'success' }} + steps: + - uses: actions/download-artifact@v4 + with: + name: knip-results + run-id: ${{ github.event.workflow_run.id }} + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Read pr number + id: pr-number + uses: juliangruber/read-file-action@v1 + with: + path: ./pr-number.txt + trim: true + + - name: Report knip results to pull request + uses: gitcoindev/knip-reporter@main + with: + verbose: true + comment_id: ${{ github.workflow }}-reporter + command_script_name: knip-ci + annotations: true + ignore_results: false + json_input: true + json_input_file_name: knip-results.json + pull_request_number: ${{ steps.pr-number.outputs.content }} + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/knip.yml b/.github/workflows/knip.yml new file mode 100644 index 0000000..809976b --- /dev/null +++ b/.github/workflows/knip.yml @@ -0,0 +1,38 @@ +name: Knip + +on: + pull_request: + +jobs: + run-knip: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + # needed to use yarn v4 + - name: Enable corepack + run: corepack enable + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 20.10.0 + + - name: Install toolchain + run: yarn install + + - name: Store PR number + run: echo ${{ github.event.number }} > pr-number.txt + + - name: Run Knip + run: yarn knip || yarn knip --reporter json > knip-results.json + + - name: Upload knip result + if: failure() + uses: actions/upload-artifact@v4 + with: + name: knip-results + path: | + knip-results.json + pr-number.txt diff --git a/.github/workflows/no-empty-strings.yml b/.github/workflows/no-empty-strings.yml new file mode 100644 index 0000000..c303cc2 --- /dev/null +++ b/.github/workflows/no-empty-strings.yml @@ -0,0 +1,32 @@ +name: Empty String Check + +on: + pull_request: + types: [opened, synchronize, reopened] + +jobs: + check-for-empty-strings: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "20.10.0" + - name: Get GitHub App token + uses: tibdex/github-app-token@v1.7.0 + id: get_installation_token + with: + app_id: ${{ secrets.APP_ID }} + private_key: ${{ secrets.APP_PRIVATE_KEY }} + - name: Install Dependencies + run: | + yarn add tsx simple-git + - name: Check for Empty Strings + run: | + yarn tsx .github/empty-string-checker.ts + env: + GITHUB_TOKEN: ${{ steps.get_installation_token.outputs.token }} + GITHUB_REPOSITORY: ${{ github.repository }} + GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }} + GITHUB_BASE_REF: ${{ github.base_ref }} diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000..a38ccee --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,20 @@ +name: release-please + +on: + workflow_dispatch: + push: + branches: + - main + +permissions: + contents: write + pull-requests: write + +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: googleapis/release-please-action@v4 + with: + release-type: simple + target-branch: main diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100755 index 0000000..b78bacb --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +yarn commitlint --edit "$1" \ No newline at end of file diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..5a182ef --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +yarn lint-staged diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..790e110 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v20.10.0 diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..816d7f8 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,10 @@ +{ + "trailingComma": "es5", + "tabWidth": 2, + "semi": true, + "singleQuote": false, + "printWidth": 160, + "htmlWhitespaceSensitivity": "strict", + "plugins": [], + "useTabs": false +} diff --git a/.yarnrc.yml b/.yarnrc.yml new file mode 100644 index 0000000..3186f3f --- /dev/null +++ b/.yarnrc.yml @@ -0,0 +1 @@ +nodeLinker: node-modules diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..c6d3097 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,110 @@ +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig to read more about this file */ + + /* Projects */ + // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ + // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ + // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ + // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ + // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ + // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ + + /* Language and Environment */ + "target": "es2016" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */, + // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ + // "jsx": "preserve", /* Specify what JSX code is generated. */ + // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ + // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ + // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ + // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ + // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ + // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ + // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ + // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ + // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ + + /* Modules */ + "module": "commonjs" /* Specify what module code is generated. */, + // "rootDir": "./", /* Specify the root folder within your source files. */ + // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ + // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ + // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ + // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ + // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ + // "types": [], /* Specify type package names to be included without being referenced in a source file. */ + // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ + // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ + // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */ + // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ + // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ + // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ + // "resolveJsonModule": true, /* Enable importing .json files. */ + // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ + // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ + + /* 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. */ + // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ + + /* 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. */ + // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ + // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ + // "outDir": "./", /* Specify an output folder for all emitted files. */ + // "removeComments": true, /* Disable emitting comments. */ + // "noEmit": true, /* Disable emitting files from a compilation. */ + // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ + // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ + // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ + // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ + // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ + // "newLine": "crlf", /* Set the newline character for emitting files. */ + // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ + // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ + // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ + // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ + // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ + // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ + + /* Interop Constraints */ + // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ + // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ + // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ + "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */, + // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ + "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */, + + /* Type Checking */ + "strict": true /* Enable all strict type-checking options. */, + // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ + // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ + // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ + // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ + // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ + // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ + // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ + // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ + // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ + // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ + // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ + // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ + // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ + // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ + // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ + // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ + // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ + + /* Completeness */ + // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ + "skipLibCheck": true /* Skip type checking all .d.ts files. */, + "resolveJsonModule": true + } +}