woocommerce/plugins/woocommerce-admin/client/tsconfig.json

50 lines
1.5 KiB
JSON
Raw Normal View History

Enable Typescript checking on ./client folder (https://github.com/woocommerce/woocommerce-admin/pull/8372) * Copied .tsconfig into ./client to enable ts checking - Made sub-repos composite typescript packages where necessary * Prevent tsc from transpiling ./client - we use webpack for transpiling so no need for this * Added tsc resolution path for @automattic/explat-client - Seems like there's a type export issue (?) with @automattic/explat-client and @automattic/explat-client-react-helpers - adding the node_modules/@automattic/explat-client path in tsconfig seems to help TS resolve this using the source .ts files - found answer here: https://github.com/microsoft/TypeScript/issues/42873 - should figure out what's actually wrong with the type exports and fix that there instead * Removed mandatory checking from webpack - removed this for now as it will block all development until all type inconsistencies are fixed - for now, run the optional ts:check task either in console or vscode for highlighting type errors * Added vscode tasks for typescript checking * Patch @automattic/explat-client-react-helpers - this changes the installed code in node_modules (post-installation) for @automattic/explat-client-react-helpers so that it exports the necessary type interfaces required by us - attempted unsuccessfully to override type exports using declare module - not too sure how to fix this internally by other means - have to investigate what fixes to propose to @automattic/explat-client-react-helpers team * changed tests in ./client to use ts-jest instead of babel-jest - rewrote jest config to use ts-jest instead of babel-jest - set ts errors to warnings instead so that tests don't fail on type errors - created new tsconfig for ./packages/js-tests so that build and ts-check are separate, as js-tests need to be built for commonjs
2022-03-01 04:19:07 +00:00
{
"compilerOptions": {
// Target latest version of ECMAScript.
"target": "esnext",
// Search under node_modules for non-relative imports.
"moduleResolution": "node",
// Process & infer types from .js files.
"allowJs": true,
"jsx": "preserve",
// Enable strictest settings like strictNullChecks & noImplicitAny.
"strict": true,
// Import non-ES modules as default imports.
"esModuleInterop": true,
"skipLibCheck": true,
"noEmit": true,
"module": "esnext",
"typeRoots": [
"../typings",
"../node_modules/@types",
2022-03-25 08:06:14 +00:00
"../../../packages/js/**/node_modules/@types"
Enable Typescript checking on ./client folder (https://github.com/woocommerce/woocommerce-admin/pull/8372) * Copied .tsconfig into ./client to enable ts checking - Made sub-repos composite typescript packages where necessary * Prevent tsc from transpiling ./client - we use webpack for transpiling so no need for this * Added tsc resolution path for @automattic/explat-client - Seems like there's a type export issue (?) with @automattic/explat-client and @automattic/explat-client-react-helpers - adding the node_modules/@automattic/explat-client path in tsconfig seems to help TS resolve this using the source .ts files - found answer here: https://github.com/microsoft/TypeScript/issues/42873 - should figure out what's actually wrong with the type exports and fix that there instead * Removed mandatory checking from webpack - removed this for now as it will block all development until all type inconsistencies are fixed - for now, run the optional ts:check task either in console or vscode for highlighting type errors * Added vscode tasks for typescript checking * Patch @automattic/explat-client-react-helpers - this changes the installed code in node_modules (post-installation) for @automattic/explat-client-react-helpers so that it exports the necessary type interfaces required by us - attempted unsuccessfully to override type exports using declare module - not too sure how to fix this internally by other means - have to investigate what fixes to propose to @automattic/explat-client-react-helpers team * changed tests in ./client to use ts-jest instead of babel-jest - rewrote jest config to use ts-jest instead of babel-jest - set ts errors to warnings instead so that tests don't fail on type errors - created new tsconfig for ./packages/js-tests so that build and ts-check are separate, as js-tests need to be built for commonjs
2022-03-01 04:19:07 +00:00
],
"baseUrl": "./",
"paths": {
2022-03-25 08:06:14 +00:00
"@woocommerce/*": [ "../../../packages/js/*/src" ],
Enable Typescript checking on ./client folder (https://github.com/woocommerce/woocommerce-admin/pull/8372) * Copied .tsconfig into ./client to enable ts checking - Made sub-repos composite typescript packages where necessary * Prevent tsc from transpiling ./client - we use webpack for transpiling so no need for this * Added tsc resolution path for @automattic/explat-client - Seems like there's a type export issue (?) with @automattic/explat-client and @automattic/explat-client-react-helpers - adding the node_modules/@automattic/explat-client path in tsconfig seems to help TS resolve this using the source .ts files - found answer here: https://github.com/microsoft/TypeScript/issues/42873 - should figure out what's actually wrong with the type exports and fix that there instead * Removed mandatory checking from webpack - removed this for now as it will block all development until all type inconsistencies are fixed - for now, run the optional ts:check task either in console or vscode for highlighting type errors * Added vscode tasks for typescript checking * Patch @automattic/explat-client-react-helpers - this changes the installed code in node_modules (post-installation) for @automattic/explat-client-react-helpers so that it exports the necessary type interfaces required by us - attempted unsuccessfully to override type exports using declare module - not too sure how to fix this internally by other means - have to investigate what fixes to propose to @automattic/explat-client-react-helpers team * changed tests in ./client to use ts-jest instead of babel-jest - rewrote jest config to use ts-jest instead of babel-jest - set ts errors to warnings instead so that tests don't fail on type errors - created new tsconfig for ./packages/js-tests so that build and ts-check are separate, as js-tests need to be built for commonjs
2022-03-01 04:19:07 +00:00
"~/*": [ "./*" ]
},
"declaration": false,
"rootDir": "./"
},
"exclude": [ "node_modules", "build", "build-module", "dist", "vendor" ],
"references": [
2022-03-25 08:06:14 +00:00
{ "path": "../../../packages/js/admin-e2e-tests" },
{ "path": "../../../packages/js/components" },
{ "path": "../../../packages/js/csv-export" },
{ "path": "../../../packages/js/currency" },
{ "path": "../../../packages/js/customer-effort-score" },
{ "path": "../../../packages/js/data" },
{ "path": "../../../packages/js/date" },
{ "path": "../../../packages/js/experimental" },
{ "path": "../../../packages/js/explat" },
{ "path": "../../../packages/js/js-tests" },
{ "path": "../../../packages/js/navigation" },
{ "path": "../../../packages/js/notices" },
{ "path": "../../../packages/js/number" },
{ "path": "../../../packages/js/onboarding" },
{ "path": "../../../packages/js/tracks" }
]
Enable Typescript checking on ./client folder (https://github.com/woocommerce/woocommerce-admin/pull/8372) * Copied .tsconfig into ./client to enable ts checking - Made sub-repos composite typescript packages where necessary * Prevent tsc from transpiling ./client - we use webpack for transpiling so no need for this * Added tsc resolution path for @automattic/explat-client - Seems like there's a type export issue (?) with @automattic/explat-client and @automattic/explat-client-react-helpers - adding the node_modules/@automattic/explat-client path in tsconfig seems to help TS resolve this using the source .ts files - found answer here: https://github.com/microsoft/TypeScript/issues/42873 - should figure out what's actually wrong with the type exports and fix that there instead * Removed mandatory checking from webpack - removed this for now as it will block all development until all type inconsistencies are fixed - for now, run the optional ts:check task either in console or vscode for highlighting type errors * Added vscode tasks for typescript checking * Patch @automattic/explat-client-react-helpers - this changes the installed code in node_modules (post-installation) for @automattic/explat-client-react-helpers so that it exports the necessary type interfaces required by us - attempted unsuccessfully to override type exports using declare module - not too sure how to fix this internally by other means - have to investigate what fixes to propose to @automattic/explat-client-react-helpers team * changed tests in ./client to use ts-jest instead of babel-jest - rewrote jest config to use ts-jest instead of babel-jest - set ts errors to warnings instead so that tests don't fail on type errors - created new tsconfig for ./packages/js-tests so that build and ts-check are separate, as js-tests need to be built for commonjs
2022-03-01 04:19:07 +00:00
}