Skip to content

Commit

Permalink
chore: set up typescript-strict-plugin to help enable strict mode g…
Browse files Browse the repository at this point in the history
…lobally (#11177)

**Related Issue:** N/A

## Summary

Wires up
[`typescript-strict-plugin`](https://github.com/allegro/typescript-strict-plugin)
to incrementally convert files to be strict.

### Notable changes

* Adds `@ts-strict-ignore` comments to files within scope to allow
opting into strict mode incrementally
* Enables strict mode for packages with no existing strict errors
* Examples and files not covered by existing `tsconfig.json` files
(e.g., support files executed via `tsx`) are not included – I'll create
a follow-up PR for these
  • Loading branch information
jcfranco authored Jan 1, 2025
1 parent a11a496 commit adefb85
Show file tree
Hide file tree
Showing 266 changed files with 569 additions and 20 deletions.
269 changes: 269 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
"tsx": "4.19.2",
"turbo": "2.3.3",
"typescript": "5.6.3",
"typescript-strict-plugin": "2.4.4",
"vite": "5.4.11"
},
"license": "SEE LICENSE.md",
Expand Down
11 changes: 6 additions & 5 deletions packages/calcite-components-react/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"compilerOptions": {
"allowUnreachableCode": false,
"allowSyntheticDefaultImports": true,
"allowUnreachableCode": false,
"declaration": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"esModuleInterop": true,
"experimentalDecorators": true,
"jsx": "react",
"lib": ["dom", "es2015"],
"module": "esnext",
"moduleResolution": "node",
Expand All @@ -15,9 +16,9 @@
"noUnusedParameters": true,
"outDir": "dist",
"removeComments": false,
"jsx": "react",
"target": "es2015",
"skipLibCheck": true
"skipLibCheck": true,
"strict": true,
"target": "es2015"
},
"include": ["src/**/*.ts", "src/**/*.tsx"]
}
1 change: 1 addition & 0 deletions packages/calcite-components/calcite-preset.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-strict-ignore
import flattenColorPalette from "tailwindcss/lib/util/flattenColorPalette";
import plugin from "tailwindcss/plugin";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-strict-ignore
import { LitElement, property, createEvent, h, method, state, JsxNode } from "@arcgis/lumina";
import {
closestElementCrossShadowBoundary,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-strict-ignore
import { newE2EPage } from "@arcgis/lumina-compiler/puppeteerTesting";
import { describe, expect, it } from "vitest";
import { html } from "../../../support/formatting";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-strict-ignore
import { debounce } from "lodash-es";
import { PropertyValues } from "lit";
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-strict-ignore
import { PropertyValues } from "lit";
import { LitElement, property, h, method, state, JsxNode, ToEvents } from "@arcgis/lumina";
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-strict-ignore
import { E2EPage, newE2EPage } from "@arcgis/lumina-compiler/puppeteerTesting";
import { beforeEach, describe, expect, it } from "vitest";
import { html } from "../../../support/formatting";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-strict-ignore
import { PropertyValues } from "lit";
import {
LitElement,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-strict-ignore
import { PropertyValues } from "lit";
import { LitElement, property, createEvent, h, method, state, JsxNode } from "@arcgis/lumina";
import { focusFirstTabbable, slotChangeGetAssignedElements } from "../../utils/dom";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-strict-ignore
import { createRef } from "lit-html/directives/ref.js";
import { LitElement, property, h, method, JsxNode } from "@arcgis/lumina";
import { guid } from "../../utils/guid";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-strict-ignore
import type { Alert } from "./alert";

export const alertQueueTimeoutMs = 300;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-strict-ignore
import { newE2EPage, E2EPage, E2EElement } from "@arcgis/lumina-compiler/puppeteerTesting";
import { describe, expect, it, beforeEach } from "vitest";
import { html } from "../../../support/formatting";
Expand Down
1 change: 1 addition & 0 deletions packages/calcite-components/src/components/alert/alert.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-strict-ignore
import { PropertyValues } from "lit";
import {
LitElement,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-strict-ignore
import { LitElement, property, h, JsxNode } from "@arcgis/lumina";
import { Scale } from "../interfaces";
import { CSS } from "./resources";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-strict-ignore
import { LitElement, property, createEvent, h, JsxNode } from "@arcgis/lumina";
import { FlipContext, Scale } from "../interfaces";
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-strict-ignore
import { PropertyValues } from "lit";
import {
LitElement,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-strict-ignore
import { newE2EPage } from "@arcgis/lumina-compiler/puppeteerTesting";
import { describe, expect, it } from "vitest";
import { accessible, defaults, hidden, renders, themed } from "../../tests/commonTests";
Expand Down
Loading

0 comments on commit adefb85

Please sign in to comment.