| { |
| "compilerOptions": { |
| "lib": ["es2019", "dom", "dom.iterable", "webworker"], |
| "allowJs": true, |
| "jsx": "react-jsx", |
| "jsxImportSource": "@emotion/react", |
| "target": "ESNext", |
| "sourceMap": true, |
| "outDir": "dist/", |
| "noEmit": true, |
| "isolatedModules": true, |
| "strict": true, |
| "noUnusedLocals": true, |
| "noUnusedParameters": true, |
| "noImplicitReturns": true, |
| "noFallthroughCasesInSwitch": true, |
| "noEmitOnError": true, |
| "module": "ES2022", |
| // We have to use `"moduleResolution": "Bundler"` as this is required by |
| // `vite@5`. |
| "moduleResolution": "Bundler", |
| "resolveJsonModule": true, |
| "types": [ |
| "@types/gapi", |
| "@types/gtag.js", |
| "@types/jest", |
| "vite/client", |
| ], |
| "allowSyntheticDefaultImports": true, |
| "esModuleInterop": true, |
| "experimentalDecorators": true, |
| "forceConsistentCasingInFileNames": true, |
| // This is required by mobx@6 [1]. But it will break lit-element reactive |
| // properties [2]. We need to enable this since |
| // 1. This will be the default moving forward [3], and |
| // 2. mobx@6 is required to support react@17, and |
| // 3. react@17 is required to support react-in-lit event dispatching [4]. |
| // |
| // As a result, we need to |
| // 1. stop relying on lit-element reactive properties, and |
| // 2. use mobx reactive properties instead, and |
| // 3. use LitElement.updated to emulate property update if necessary. |
| // 4. use `static get properties() { return {...} }` to define attributes if |
| // needed. |
| // |
| // [1]: https://mobx.js.org/migrating-from-4-or-5.html#getting-started |
| // [2]: https://lit.dev/docs/components/properties/#avoiding-issues-with-class-fields |
| // [3]: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#the-usedefineforclassfields-flag-and-the-declare-property-modifier |
| // [4]: https://reactjs.org/blog/2020/10/20/react-v17.html#changes-to-event-delegation |
| "useDefineForClassFields": true, |
| "paths": { |
| "@/*": ["./src/*"], |
| "@root/*": ["./*"], |
| } |
| }, |
| "ts-node": { |
| "compilerOptions": { |
| // We cannot use `"moduleResolution": "bundler"` because jest doesn't use |
| // a bundler when building the test code. |
| "module": "ESNext", |
| "moduleResolution": "Node" |
| } |
| }, |
| "exclude": [ |
| // Exclude cypress to avoid cypress/jest type conflicts. |
| "cypress", |
| "cypress.config.ts", |
| // No need to validate the dependencies. |
| "node_modules", |
| // No need to validate the output. |
| "dist", |
| // Exclude the generated proto bindings to make type check faster. |
| "src/proto", |
| ] |
| } |