From 6bcd8253dd16cad773aeb7168234093d5a589305 Mon Sep 17 00:00:00 2001 From: Eric Fennis Date: Fri, 18 Sep 2026 12:33:49 +0200 Subject: [PATCH] Add typecheck jobs --- .github/workflows/lucide-astro.yml | 16 ++++++++++++++++ .github/workflows/lucide-font.yml | 16 ++++++++++++++++ .github/workflows/lucide-lab.yml | 16 ++++++++++++++++ .github/workflows/lucide-preact.yml | 16 ++++++++++++++++ .github/workflows/lucide-react-native.yml | 16 ++++++++++++++++ .github/workflows/lucide-react.yml | 16 ++++++++++++++++ .github/workflows/lucide-shared.yml | 16 ++++++++++++++++ .github/workflows/lucide-solid.yml | 16 ++++++++++++++++ .github/workflows/lucide-static.yml | 16 ++++++++++++++++ .github/workflows/lucide-svelte-5.yml | 2 +- .github/workflows/lucide.yml | 16 ++++++++++++++++ .gitignore | 1 + packages/astro/package.json | 4 +++- packages/astro/src/Icon.astro | 2 +- packages/lab/package.json | 3 ++- packages/lab/tsconfig.json | 3 ++- packages/lucide-preact/package.json | 3 ++- packages/lucide-preact/tests/testIconNodes.ts | 2 +- packages/lucide-preact/tsconfig.json | 1 - .../__mocks__/react-native-svg/index.ts | 2 +- packages/lucide-react-native/package.json | 3 ++- packages/lucide-react-native/tsconfig.json | 6 ++++-- packages/lucide-react/package.json | 4 ++-- packages/lucide-solid/package.json | 2 +- packages/lucide-solid/tsconfig.json | 3 +-- packages/lucide-static/package.json | 3 ++- .../lucide-static/scripts/migrateIconsToTags.mts | 2 +- packages/lucide-static/tsconfig.json | 3 ++- packages/lucide/package.json | 3 ++- packages/lucide/src/replaceElement.ts | 2 +- packages/lucide/tsconfig.json | 1 + packages/shared/package.json | 4 +++- packages/shared/tests/toLucideIconData.spec.ts | 5 +++-- packages/shared/tsconfig.json | 7 +++++++ tools/build-font/package.json | 3 ++- tools/build-font/tsconfig.json | 1 + 36 files changed, 209 insertions(+), 26 deletions(-) create mode 100644 packages/shared/tsconfig.json diff --git a/.github/workflows/lucide-astro.yml b/.github/workflows/lucide-astro.yml index 47a1fc8dd..6da4b03eb 100644 --- a/.github/workflows/lucide-astro.yml +++ b/.github/workflows/lucide-astro.yml @@ -46,3 +46,19 @@ jobs: - name: Test run: pnpm --filter @lucide/astro test + + typecheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10 + - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 + with: + node-version-file: 'package.json' + cache: 'pnpm' + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Typecheck + run: pnpm --filter @lucide/astro typecheck diff --git a/.github/workflows/lucide-font.yml b/.github/workflows/lucide-font.yml index 7548723cb..2709fed13 100644 --- a/.github/workflows/lucide-font.yml +++ b/.github/workflows/lucide-font.yml @@ -37,3 +37,19 @@ jobs: with: name: lucide-font path: lucide-font + + typecheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10 + - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 + with: + cache: 'pnpm' + node-version-file: 'package.json' + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Typecheck + run: pnpm --filter build-font typecheck diff --git a/.github/workflows/lucide-lab.yml b/.github/workflows/lucide-lab.yml index 67c7e7e20..1afd71f0d 100644 --- a/.github/workflows/lucide-lab.yml +++ b/.github/workflows/lucide-lab.yml @@ -29,3 +29,19 @@ jobs: - name: Build run: pnpm --filter @lucide/lab build + + typecheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10 + - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 + with: + cache: 'pnpm' + node-version-file: 'package.json' + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Typecheck + run: pnpm --filter @lucide/lab typecheck diff --git a/.github/workflows/lucide-preact.yml b/.github/workflows/lucide-preact.yml index f842c1b47..926d4f0aa 100644 --- a/.github/workflows/lucide-preact.yml +++ b/.github/workflows/lucide-preact.yml @@ -31,3 +31,19 @@ jobs: - name: Test run: pnpm --filter lucide-preact test + + typecheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10 + - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 + with: + cache: 'pnpm' + node-version-file: 'package.json' + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Typecheck + run: pnpm --filter lucide-preact typecheck diff --git a/.github/workflows/lucide-react-native.yml b/.github/workflows/lucide-react-native.yml index 6f8d83079..1f0d67255 100644 --- a/.github/workflows/lucide-react-native.yml +++ b/.github/workflows/lucide-react-native.yml @@ -47,3 +47,19 @@ jobs: - name: Test run: pnpm --filter lucide-react-native test + + typecheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10 + - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 + with: + cache: 'pnpm' + node-version-file: 'package.json' + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Typecheck + run: pnpm --filter lucide-react-native typecheck diff --git a/.github/workflows/lucide-react.yml b/.github/workflows/lucide-react.yml index 3e8676365..5a81ab25a 100644 --- a/.github/workflows/lucide-react.yml +++ b/.github/workflows/lucide-react.yml @@ -70,3 +70,19 @@ jobs: - name: Run integration checks run: pnpm test:integrations:react + + typecheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10 + - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 + with: + cache: 'pnpm' + node-version-file: 'package.json' + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Typecheck + run: pnpm --filter lucide-react typecheck diff --git a/.github/workflows/lucide-shared.yml b/.github/workflows/lucide-shared.yml index efea0dc77..c631d04e7 100644 --- a/.github/workflows/lucide-shared.yml +++ b/.github/workflows/lucide-shared.yml @@ -28,3 +28,19 @@ jobs: - name: Test run: pnpm --filter lucide-react test + + typecheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10 + - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 + with: + cache: 'pnpm' + node-version-file: 'package.json' + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Typecheck + run: pnpm --filter @lucide/shared typecheck diff --git a/.github/workflows/lucide-solid.yml b/.github/workflows/lucide-solid.yml index d78602a35..f2e4895b1 100644 --- a/.github/workflows/lucide-solid.yml +++ b/.github/workflows/lucide-solid.yml @@ -47,3 +47,19 @@ jobs: - name: Test run: pnpm --filter lucide-solid test + + typecheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10 + - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 + with: + cache: 'pnpm' + node-version-file: 'package.json' + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Typecheck + run: pnpm --filter lucide-solid typecheck diff --git a/.github/workflows/lucide-static.yml b/.github/workflows/lucide-static.yml index fee24bf72..ec9b5e674 100644 --- a/.github/workflows/lucide-static.yml +++ b/.github/workflows/lucide-static.yml @@ -26,3 +26,19 @@ jobs: - name: Build run: pnpm --filter lucide-static build + + typecheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10 + - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 + with: + cache: 'pnpm' + node-version-file: 'package.json' + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Typecheck + run: pnpm --filter lucide-static typecheck diff --git a/.github/workflows/lucide-svelte-5.yml b/.github/workflows/lucide-svelte-5.yml index 4f48fcf19..946d650d3 100644 --- a/.github/workflows/lucide-svelte-5.yml +++ b/.github/workflows/lucide-svelte-5.yml @@ -61,5 +61,5 @@ jobs: - name: Install dependencies run: pnpm install --frozen-lockfile - - name: Test + - name: Typecheck run: pnpm --filter @lucide/svelte typecheck diff --git a/.github/workflows/lucide.yml b/.github/workflows/lucide.yml index 844d2647f..5cc24ce31 100644 --- a/.github/workflows/lucide.yml +++ b/.github/workflows/lucide.yml @@ -46,3 +46,19 @@ jobs: - name: Test run: pnpm --filter lucide test + + typecheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10 + - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 + with: + cache: 'pnpm' + node-version-file: 'package.json' + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Typecheck + run: pnpm --filter lucide typecheck diff --git a/.gitignore b/.gitignore index 9003ed236..9bb98e488 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ .DS_Store .idea .next +.astro .obsidian .now .cache diff --git a/packages/astro/package.json b/packages/astro/package.json index 331fe75b4..abc2b3e5c 100644 --- a/packages/astro/package.json +++ b/packages/astro/package.json @@ -45,9 +45,11 @@ "copy:license": "cp ../../LICENSE ./LICENSE", "copy:utils": "cpy ../../packages/shared/src/build/{buildLucideIconNode.ts,defaultAttributes.ts,types.ts} ../../packages/shared/src/utils/{hasA11yProp.ts,toKebabCase.ts,mergeClasses.ts} ./src/utils/", "test": "pnpm copy:utils && pnpm build:icons && vitest run", - "test:watch": "pnpm build:icons && vitest run --watch" + "test:watch": "pnpm build:icons && vitest run --watch", + "typecheck": "pnpm copy:utils && pnpm build:icons && astro check" }, "devDependencies": { + "@astrojs/check": "^0.9.10", "@astrojs/ts-plugin": "^1.10.11", "@lucide/build-icons": "workspace:*", "@testing-library/dom": "^10.4.1", diff --git a/packages/astro/src/Icon.astro b/packages/astro/src/Icon.astro index 7d54bedfa..a2bacca75 100644 --- a/packages/astro/src/Icon.astro +++ b/packages/astro/src/Icon.astro @@ -11,7 +11,7 @@ const { 'stroke-width': strokeWidth = 2, absoluteStrokeWidth = false, nonScalingStroke = false, - iconNode, + iconNode = [], icon = { node: iconNode, aliases: [], diff --git a/packages/lab/package.json b/packages/lab/package.json index 6191fdca2..2155c1c72 100644 --- a/packages/lab/package.json +++ b/packages/lab/package.json @@ -36,7 +36,8 @@ "build:icons": "build-icons --input=../../lab --output=./src --templateSrc=./scripts/exportTemplate.mts --iconFileExtension=.ts --exportModuleNameCasing=camel --renderUniqueKey --exportFileName=index.ts", "build:lib": "node ./scripts/buildLib.mts", "build:bundle": "rollup -c rollup.config.mjs", - "clean": "rm -f src/icons/*.ts && rm -rf dist && rm -rf icons && rm -f icon-nodes.json" + "clean": "rm -f src/icons/*.ts && rm -rf dist && rm -rf icons && rm -f icon-nodes.json", + "typecheck": "pnpm build:icons && tsc --noEmit" }, "devDependencies": { "@lucide/build-icons": "workspace:*", diff --git a/packages/lab/tsconfig.json b/packages/lab/tsconfig.json index 479ed0ac1..4ae8ddc18 100644 --- a/packages/lab/tsconfig.json +++ b/packages/lab/tsconfig.json @@ -14,5 +14,6 @@ "allowImportingTsExtensions": true, "sourceMap": true, "outDir": "./dist" - } + }, + "include": ["src", "scripts"] } diff --git a/packages/lucide-preact/package.json b/packages/lucide-preact/package.json index 0b9883c26..c0637adf2 100644 --- a/packages/lucide-preact/package.json +++ b/packages/lucide-preact/package.json @@ -44,7 +44,8 @@ "build:icons": "build-icons --output=./src --templateSrc=./scripts/exportTemplate.mts --renderUniqueKey --withAliases --aliasesFileExtension=.ts --iconFileExtension=.ts --exportFileName=index.ts", "build:bundles": "rollup -c ./rollup.config.mjs", "test": "pnpm build:icons && vitest run", - "test:watch": "vitest watch" + "test:watch": "vitest watch", + "typecheck": "pnpm build:icons && tsc" }, "devDependencies": { "@lucide/build-icons": "workspace:*", diff --git a/packages/lucide-preact/tests/testIconNodes.ts b/packages/lucide-preact/tests/testIconNodes.ts index 8c593572d..6da6aefd3 100644 --- a/packages/lucide-preact/tests/testIconNodes.ts +++ b/packages/lucide-preact/tests/testIconNodes.ts @@ -1,4 +1,4 @@ -import { IconNode } from '../src/createLucideIcon'; +import type { IconNode } from '../src/types'; export const airVent: IconNode = [ [ diff --git a/packages/lucide-preact/tsconfig.json b/packages/lucide-preact/tsconfig.json index 5e21a5f7e..4cf0d753e 100644 --- a/packages/lucide-preact/tsconfig.json +++ b/packages/lucide-preact/tsconfig.json @@ -19,7 +19,6 @@ "resolveJsonModule": true, "allowSyntheticDefaultImports": true, "sourceMap": true, - "outDir": "./dist", "jsx": "react-jsx", "jsxImportSource": "preact", "types": ["@testing-library/jest-dom/vitest"] diff --git a/packages/lucide-react-native/__mocks__/react-native-svg/index.ts b/packages/lucide-react-native/__mocks__/react-native-svg/index.ts index b61dec342..308ff57fe 100644 --- a/packages/lucide-react-native/__mocks__/react-native-svg/index.ts +++ b/packages/lucide-react-native/__mocks__/react-native-svg/index.ts @@ -1,6 +1,6 @@ // https://github.com/FormidableLabs/react-native-svg-mock import React from 'react'; -import type { LucideProps } from '../../src/createReactComponent'; +import type { LucideProps } from '../../src/types'; export type { SvgProps } from 'react-native-svg'; const createComponent = function (name: string) { diff --git a/packages/lucide-react-native/package.json b/packages/lucide-react-native/package.json index d672a4830..c68e8566c 100644 --- a/packages/lucide-react-native/package.json +++ b/packages/lucide-react-native/package.json @@ -61,7 +61,8 @@ "build:icons": "build-icons --output=./src --templateSrc=./scripts/exportTemplate.mts --renderUniqueKey --iconFileExtension=.ts --exportFileName=index.ts --withAliases --separateAliasesFile --separateAliasesFileIgnore=fingerprint --aliasesFileExtension=.ts", "build:bundles": "rollup -c ./rollup.config.mjs", "test": "pnpm build:icons && vitest run", - "test:watch": "vitest watch" + "test:watch": "vitest watch", + "typecheck": "pnpm build:icons && tsc" }, "devDependencies": { "@lucide/build-icons": "workspace:*", diff --git a/packages/lucide-react-native/tsconfig.json b/packages/lucide-react-native/tsconfig.json index a79eb44b0..a6e45f1c6 100644 --- a/packages/lucide-react-native/tsconfig.json +++ b/packages/lucide-react-native/tsconfig.json @@ -17,7 +17,9 @@ "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, "esModuleInterop": true, - "skipLibCheck": false + "skipLibCheck": true, + "types": ["@testing-library/jest-dom/vitest"] }, - "exclude": ["node_modules"] + "exclude": ["node_modules"], + "include": ["src", "tests", "__mocks__", "vitest.config.mts"] } diff --git a/packages/lucide-react/package.json b/packages/lucide-react/package.json index a179c65f6..c2b7cb434 100644 --- a/packages/lucide-react/package.json +++ b/packages/lucide-react/package.json @@ -39,12 +39,12 @@ "dynamicIconImports.d.mts" ], "scripts": { - "build": "pnpm clean && pnpm copy:license && pnpm build:icons && pnpm typecheck && pnpm build:bundles", + "build": "pnpm clean && pnpm copy:license && pnpm build:icons && pnpm build:bundles", "copy:license": "cp ../../LICENSE ./LICENSE", "clean": "rm -rf dist && rm -rf stats && rm -rf ./src/icons/*.ts && rm -f dynamic.{d.ts,d.mts,mts,mjs,mjs.map} && rm -f dynamicIconImports.d.ts", "build:icons": "build-icons --output=./src --templateSrc=./scripts/exportTemplate.mts --renderUniqueKey --withAliases --withDynamicImports --separateAliasesFile --separateAliasesFileIgnore=fingerprint --aliasesFileExtension=.ts --iconFileExtension=.ts --exportFileName=index.ts", "build:bundles": "rollup -c ./rollup.config.mjs", - "typecheck": "tsc", + "typecheck": "pnpm build:icons && tsc", "typecheck:watch": "tsc -w", "test": "pnpm build:icons && vitest run", "test:watch": "vitest watch" diff --git a/packages/lucide-solid/package.json b/packages/lucide-solid/package.json index 7851295fe..d642fb777 100644 --- a/packages/lucide-solid/package.json +++ b/packages/lucide-solid/package.json @@ -62,7 +62,7 @@ "build:version": "node ./scripts/replaceVersion.mjs", "build:bundle": "rollup -c rollup.config.mjs", "build:icons": "build-icons --output=./src --templateSrc=./scripts/exportTemplate.mts --renderUniqueKey --withAliases --separateAliasesFile --separateAliasesFileIgnore=fingerprint --aliasesFileExtension=.ts --iconFileExtension=.tsx --exportFileName=index.ts", - "typecheck": "tsc", + "typecheck": "pnpm build:icons && tsc", "typecheck:watch": "tsc -w", "test": "pnpm build:icons && vitest run", "test:watch": "vitest watch" diff --git a/packages/lucide-solid/tsconfig.json b/packages/lucide-solid/tsconfig.json index a0f34da4d..ffe4dacd2 100644 --- a/packages/lucide-solid/tsconfig.json +++ b/packages/lucide-solid/tsconfig.json @@ -15,8 +15,7 @@ "types": ["vite/client", "@testing-library/jest-dom/vitest"], "noEmit": true, "isolatedModules": true, - "outDir": "./dist", - "declarationDir": "./dist", + "skipLibCheck": true, "declaration": true } } diff --git a/packages/lucide-static/package.json b/packages/lucide-static/package.json index 3030f1cf6..d599da9e3 100644 --- a/packages/lucide-static/package.json +++ b/packages/lucide-static/package.json @@ -34,7 +34,8 @@ "build:icons": "build-icons --output=./src --templateSrc=./scripts/exportTemplate.mts --iconFileExtension=.ts --withAliases --aliasNamesOnly --aliasesFileExtension=.ts --exportFileName=index.ts", "build:lib": "node ./scripts/buildLib.mts", "build:bundles": "rollup -c rollup.config.mjs", - "clean": "rm -rf lib && rm -rf build && rm -rf icons && rm -f sprite.svg" + "clean": "rm -rf lib && rm -rf build && rm -rf icons && rm -f sprite.svg", + "typecheck": "pnpm build:icons && tsc --noEmit" }, "devDependencies": { "@lucide/build-icons": "workspace:*", diff --git a/packages/lucide-static/scripts/migrateIconsToTags.mts b/packages/lucide-static/scripts/migrateIconsToTags.mts index 64228b1cf..03970e9b5 100644 --- a/packages/lucide-static/scripts/migrateIconsToTags.mts +++ b/packages/lucide-static/scripts/migrateIconsToTags.mts @@ -9,7 +9,7 @@ const icons = await readAllMetadata(ICONS_DIR); const tags = Object.keys(icons) .sort() - .reduce((acc, iconName) => { + .reduce>((acc, iconName) => { acc[iconName] = icons[iconName].tags; return acc; }, {}); diff --git a/packages/lucide-static/tsconfig.json b/packages/lucide-static/tsconfig.json index 479ed0ac1..4ae8ddc18 100644 --- a/packages/lucide-static/tsconfig.json +++ b/packages/lucide-static/tsconfig.json @@ -14,5 +14,6 @@ "allowImportingTsExtensions": true, "sourceMap": true, "outDir": "./dist" - } + }, + "include": ["src", "scripts"] } diff --git a/packages/lucide/package.json b/packages/lucide/package.json index 6aafc661b..1f59bb2f1 100644 --- a/packages/lucide/package.json +++ b/packages/lucide/package.json @@ -39,7 +39,8 @@ "build:icons": "build-icons --output=./src --templateSrc=./scripts/exportTemplate.mts --iconFileExtension=.ts --withAliases --aliasNamesOnly --aliasesFileExtension=.ts --exportFileName=index.ts", "build:bundle": "rollup -c rollup.config.mjs", "test": "pnpm build:icons && vitest run", - "test:watch": "vitest watch" + "test:watch": "vitest watch", + "typecheck": "pnpm build:icons && tsc --noEmit" }, "devDependencies": { "@lucide/build-icons": "workspace:*", diff --git a/packages/lucide/src/replaceElement.ts b/packages/lucide/src/replaceElement.ts index 306df5bee..e3dacfc4f 100644 --- a/packages/lucide/src/replaceElement.ts +++ b/packages/lucide/src/replaceElement.ts @@ -22,7 +22,7 @@ export const getAttrs = (element: Element): Record => * @returns {Array} */ export const getClassNames = ( - attrs: Record | string, + attrs: Record | string, ): string | string[] => { if (typeof attrs === 'string') return attrs; if (!attrs || !attrs.class) return ''; diff --git a/packages/lucide/tsconfig.json b/packages/lucide/tsconfig.json index b6614e7e8..dea9fd65f 100644 --- a/packages/lucide/tsconfig.json +++ b/packages/lucide/tsconfig.json @@ -11,6 +11,7 @@ "allowJs": true, "lib": ["esnext", "dom"], "resolveJsonModule": true, + "skipLibCheck": true, "sourceMap": true, "outDir": "./dist" } diff --git a/packages/shared/package.json b/packages/shared/package.json index c74f005e3..bf0c86002 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -10,7 +10,8 @@ "license": "ISC", "scripts": { "test": "vitest run", - "test:watch": "vitest watch" + "test:watch": "vitest watch", + "typecheck": "tsc" }, "exports": { ".": "./src/index.ts", @@ -20,6 +21,7 @@ } }, "devDependencies": { + "@types/node": "^26.4.1", "vite": "^7.3.6" } } diff --git a/packages/shared/tests/toLucideIconData.spec.ts b/packages/shared/tests/toLucideIconData.spec.ts index b08c79f07..bbb321b93 100644 --- a/packages/shared/tests/toLucideIconData.spec.ts +++ b/packages/shared/tests/toLucideIconData.spec.ts @@ -1,9 +1,10 @@ import { describe, it, expect } from 'vitest'; import { toLucideIconData } from '../src/utils/toLucideIconData'; +import type { LucideIconNode } from '../src/build/types'; describe('toLucideIconData', () => { it('converts legacy name and node to icon data object', () => { - const iconNode = [['path', { d: 'M0 0h1' }]]; + const iconNode: LucideIconNode[] = [['path', { d: 'M0 0h1' }]]; expect(toLucideIconData('AirVent', iconNode)).toEqual({ name: 'air-vent', @@ -13,7 +14,7 @@ describe('toLucideIconData', () => { }); it('adds aliases when provided for legacy input', () => { - const iconNode = [['path', { d: 'M0 0h1' }]]; + const iconNode: LucideIconNode[] = [['path', { d: 'M0 0h1' }]]; expect(toLucideIconData('AirVent', iconNode, ['vent'])).toEqual({ name: 'air-vent', diff --git a/packages/shared/tsconfig.json b/packages/shared/tsconfig.json new file mode 100644 index 000000000..e6e47d48c --- /dev/null +++ b/packages/shared/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "types": ["node"] + }, + "include": ["src", "tests"] +} diff --git a/tools/build-font/package.json b/tools/build-font/package.json index 88134db75..114b8a55a 100644 --- a/tools/build-font/package.json +++ b/tools/build-font/package.json @@ -7,7 +7,8 @@ "type": "module", "scripts": { "start": "node ./src/main.ts", - "test": "vitest run" + "test": "vitest run", + "typecheck": "tsc" }, "keywords": [], "author": "", diff --git a/tools/build-font/tsconfig.json b/tools/build-font/tsconfig.json index a9a7df10d..e0b361b59 100644 --- a/tools/build-font/tsconfig.json +++ b/tools/build-font/tsconfig.json @@ -10,6 +10,7 @@ "esModuleInterop": true, "lib": ["esnext"], "resolveJsonModule": true, + "skipLibCheck": true, "allowImportingTsExtensions": true, "noEmit": true, "sourceMap": true,