// SPDX-License-Identifier: MIT
// SPDX-FileCopyrightText: Beslogic Inc.

{
  "compilerOptions": {
    "strict": true,
    "checkJs": true,
    "incremental": true, // Performance improvement during dev through incremental checking
    "resolveJsonModule": true,
    "noFallthroughCasesInSwitch": true,
    "noImplicitOverride": true,
    "noImplicitReturns": true,
    "strictNullChecks": true, // Stop hiding null/undefined types, *even* with strict=false !
    // This makes index accesses even stricter. You may not want it in your project.
    // You should probably disable it at least in tests.
    "noUncheckedIndexedAccess": true,
    "module": "ESNext", // ESNext or CommonJS
    // See: https://github.com/angular/angular-cli/blob/16.2.0/packages/angular_devkit/build_angular/src/tools/webpack/plugins/typescript.ts#L36-L39
    "target": "ES2022", // ES2022 or higher,
    "lib": [
      "DOM",
      "DOM.Iterable",
      // https://www.typescriptlang.org/tsconfig/#high-level-libraries
      // TypeScript will automatically match at least the target version set above
      // ES2022 or higher for Array#at()
      // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-at.md
      // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-negative-index.md
      "ES2022",
      // ES2023.Array for Array#toReversed(), Array#toSorted(), Array#toSpliced()
      "ES2023.Array"
    ],
    "verbatimModuleSyntax": true,
    // Since these are no longer needed for most projects with TypeScript 5, let's
    // disable it so @typescript-eslint/consistent-type-imports doesn't turn
    // itself off in files using decorators.
    // Likely still needed in Angular, if you wanna try without,
    // see https://angular.dev/reference/migrations/inject-function for migrating @Inject
    //
    // https://typescript-eslint.io/rules/consistent-type-imports/#caveat-decorators--experimentaldecorators-true--emitdecoratormetadata-true
    "emitDecoratorMetadata": false,
    "experimentalDecorators": false
  },
  // https://next.angular.dev/reference/configs/angular-compiler-options
  "angularCompilerOptions": {
    // "strictMetadataEmit": true, // For bundling with an npm package
    "enableI18nLegacyMessageIdFormat": false,
    "strictInjectionParameters": true,
    "strictInputAccessModifiers": true,
    "strictTemplates": true,
    // See: https://github.com/angular/angular/issues/35958#issuecomment-597362397
    // It's preferable and more intuitive to disable this check over using $any() to use specific event types.
    "strictDomEventTypes": false
  }
}
