// This configuration a standard baseline for all packages
{
    "compilerOptions": {
        // Participate in workspace
        "composite": true,

        // Add compatibility with CommonJS modules
        "esModuleInterop": true,

        // Compile incrementally using tsbuildinfo state file
        "incremental": true,

        // Matter.js most likely won't work with older versions of ES
        "target": "es2022",

        // Generate modules as ES2020 or CommonJS
        "module": "node16",

        // Use node-style dependency resolution
        "moduleResolution": "node16",

        // Do not load globals from node_modules by default
        "types": [],

        // Preserve const enums with tsc (esbuild does this by default)
        "preserveConstEnums": true,

        // Validating imports would be nice but is very slow; we can get by without
        "skipLibCheck": true,

        "customConditions": [ "dev-types" ],

        "lib": [
            "es2022",

            "ESNext.Disposable",
        
            // Many standard types are only available via node or DOM.  Neither are fully appropriate for our purposes,
            // however the DOM types are closer to the standard and add fewer objects that are not present at runtime
            // (namely window and document, which we don't have much use for and know to avoid)
            //
            // Unfortunately TS doesn't break types into individual libs, so we must import the entire DOM
            "dom"
        ],

        // Enforce a subset of our code conventions
        "forceConsistentCasingInFileNames": true,
        "noImplicitAny": true,
        "noImplicitOverride": true,
        "noUnusedParameters": true,
        "noUnusedLocals": true,
        "strict": true,
        "isolatedModules": true,
    }
}
