diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 48e0052d..aa86330d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,6 +23,8 @@ jobs: CI: true - name: Lint run: npm run lint + - name: Lint Files, Dependencies, & Exports + run: npm run lint:unused format: name: File Format diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 61d4fe08..b16c608d 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -39,7 +39,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..dfe9e386 --- /dev/null +++ b/knip.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://unpkg.com/knip@5/schema.json", + "workspaces": { + ".": { + "entry": ["tests/**/*.test.{js,ts}", "tests/fixtures/*.js"], + "project": ["src/**/*.js", "src/**/*.ts"] + }, + "examples/*": { + "entry": ["**/*.*s"] + } + } +} diff --git a/package.json b/package.json index 5af2f895..a69912f0 100644 --- a/package.json +++ b/package.json @@ -61,6 +61,7 @@ "scripts": { "lint": "eslint && eslint -c eslint.config-content.js", "lint:fix": "eslint --fix && eslint --fix -c eslint.config-content.js", + "lint:unused": "knip", "fmt": "prettier --write .", "fmt:check": "prettier --check .", "build:rules": "node tools/build-rules.js", @@ -69,7 +70,7 @@ "prepare": "npm run build", "test": "mocha \"tests/**/*.test.js\" --timeout 30000", "test:coverage": "c8 npm test", - "test:jsr": "npx jsr@latest publish --dry-run", + "test:jsr": "npx -y jsr@latest publish --dry-run", "test:types": "tsc -p tests/types/tsconfig.json" }, "devDependencies": { @@ -83,6 +84,7 @@ "eslint-config-eslint": "^13.0.0", "eslint-plugin-eslint-plugin": "^6.3.2", "globals": "^16.4.0", + "knip": "^5.66.4", "lint-staged": "^15.2.9", "mocha": "^11.6.0", "prettier": "^3.3.3",