From a4fb17ae4dadc89a241dc9fb56c0aff7e2db5003 Mon Sep 17 00:00:00 2001 From: Immanuel Baskaran Date: Thu, 12 Oct 2023 16:43:15 +0100 Subject: [PATCH] Add modular directory to targetLocations checked by typecheck (#2470) * Add modular directory to targetLocations checked by typecheck * ignore create-react-app template folder when linting * fix import in create-react-app template --- .changeset/rich-snakes-drum.md | 5 +++++ .eslintrc.js | 1 + .../create-modular-react-app/template/modular/setupTests.ts | 2 +- packages/modular-scripts/src/typecheck.ts | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 .changeset/rich-snakes-drum.md diff --git a/.changeset/rich-snakes-drum.md b/.changeset/rich-snakes-drum.md new file mode 100644 index 000000000..a7102d2d0 --- /dev/null +++ b/.changeset/rich-snakes-drum.md @@ -0,0 +1,5 @@ +--- +'modular-scripts': patch +--- + +Add modular directory to targetLocations checked by typecheck diff --git a/.eslintrc.js b/.eslintrc.js index 85718b333..cecc67b11 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -21,6 +21,7 @@ module.exports = { '**/*.test.*', '**/__tests__/**', '**/modular-template-app/**', + '**/create-modular-react-app/template/**', '**/modular-template-view/**', '**/modular-template-esm-view/**', ], diff --git a/packages/create-modular-react-app/template/modular/setupTests.ts b/packages/create-modular-react-app/template/modular/setupTests.ts index 74b1a275a..8f2609b7b 100644 --- a/packages/create-modular-react-app/template/modular/setupTests.ts +++ b/packages/create-modular-react-app/template/modular/setupTests.ts @@ -2,4 +2,4 @@ // allows you to do things like: // expect(element).toHaveTextContent(/react/i) // learn more: https://github.com/testing-library/jest-dom -import '@testing-library/jest-dom/extend-expect'; +import '@testing-library/jest-dom'; diff --git a/packages/modular-scripts/src/typecheck.ts b/packages/modular-scripts/src/typecheck.ts index a072a9bf1..cf25574c5 100644 --- a/packages/modular-scripts/src/typecheck.ts +++ b/packages/modular-scripts/src/typecheck.ts @@ -107,7 +107,7 @@ async function typecheck( 'typecheck', ); - const targetLocations: string[] = []; + const targetLocations: string[] = ['modular']; for (const [pkgName, pkg] of workspaceMap) { if (modularTargets.includes(pkgName)) { targetLocations.push(pkg.location);