From ec8bcfc65d8934ebad0e41584ed9a6eb0ecd58c2 Mon Sep 17 00:00:00 2001 From: Pixel998 Date: Fri, 30 Jan 2026 02:51:37 +0300 Subject: [PATCH] chore: add lint:unused script to run Knip --- .github/workflows/ci.yml | 2 ++ .github/workflows/release-please.yml | 2 +- knip.json | 4 ++++ package.json | 5 ++++- src/data/baseline-data.js | 1 - tools/generate-baseline.js | 1 - 6 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 knip.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2822ed4d..c439d1e9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,6 +20,8 @@ jobs: run: npm install - name: Lint files run: npm run lint + - name: Lint Files, Dependencies, & Exports + run: npm run lint:unused - name: Check Formatting run: npm run fmt:check test: diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 2d79196a..00c7dd31 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -41,7 +41,7 @@ jobs: - name: Publish to JSR run: | npm run build --if-present - npx jsr publish + npx -y jsr publish if: ${{ steps.release.outputs.release_created }} # Generates the social media post diff --git a/knip.json b/knip.json new file mode 100644 index 00000000..eaa9428f --- /dev/null +++ b/knip.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://unpkg.com/knip@5/schema.json", + "entry": ["tests/**/*.{cts,js,ts}"] +} diff --git a/package.json b/package.json index 97dcc1f4..7fddccf3 100644 --- a/package.json +++ b/package.json @@ -54,6 +54,7 @@ "lint": "eslint", "lint:fix": "eslint --fix", "lint:types": "attw --pack --profile esm-only", + "lint:unused": "knip", "fmt": "prettier --write .", "fmt:check": "prettier --check .", "test": "mocha \"tests/**/*.test.js\"", @@ -77,19 +78,21 @@ "devDependencies": { "@arethetypeswrong/cli": "^0.18.2", "@eslint/json": "^0.14.0", + "@types/node": "^25.1.0", "c8": "^10.1.3", "dedent": "^1.5.3", "eslint": "^9.39.2", "eslint-config-eslint": "^13.0.0", "eslint-plugin-eslint-plugin": "^6.3.2", "globals": "^17.0.0", + "knip": "^5.82.1", "lint-staged": "^16.0.0", "mdast-util-from-markdown": "^2.0.2", "mdn-data": "^2.26.0", "mocha": "^11.0.0", "prettier": "3.8.1", "tailwind-csstree": "^0.1.0", - "typescript": "^5.9.2", + "typescript": "^5.9.3", "web-features": "^3.14.0", "yorkie": "^2.0.0" }, diff --git a/src/data/baseline-data.js b/src/data/baseline-data.js index 394407a7..266e213e 100644 --- a/src/data/baseline-data.js +++ b/src/data/baseline-data.js @@ -7,7 +7,6 @@ export const BASELINE_HIGH = 10; export const BASELINE_LOW = 5; -export const BASELINE_FALSE = 0; export const properties = new Map([ ["accent-color", "0:"], diff --git a/tools/generate-baseline.js b/tools/generate-baseline.js index d07286f4..22c9edd1 100644 --- a/tools/generate-baseline.js +++ b/tools/generate-baseline.js @@ -205,7 +205,6 @@ const code = `/** export const BASELINE_HIGH = ${BASELINE_HIGH}; export const BASELINE_LOW = ${BASELINE_LOW}; -export const BASELINE_FALSE = ${BASELINE_FALSE}; export const properties = new Map(${JSON.stringify(Object.entries(cssFeatures.properties), null, "\t")}); export const atRules = new Map(${JSON.stringify(Object.entries(cssFeatures.atRules), null, "\t")});