diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 642321e5..56eaf868 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 b41233ab..ca1b9f70 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -32,7 +32,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..5e1b62b2 --- /dev/null +++ b/knip.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://unpkg.com/knip@5/schema.json", + "workspaces": { + ".": { + "entry": ["tests/**/*.test.js", "tests/fixtures/*.js"], + "project": ["src/**/*.js", "src/**/*.ts"] + }, + "examples/*": { + "entry": ["**/*.*s"] + } + } +} diff --git a/package.json b/package.json index 524d589f..86a2c15b 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", @@ -70,12 +71,14 @@ "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": { "@eslint/js": "^9.31.0", "@eslint/json": "^0.13.1", + "@types/mdast": "^4.0.4", + "@types/unist": "^3.0.3", "c8": "^10.1.3", "dedent": "^1.5.3", "eslint": "^9.31.0", @@ -83,9 +86,11 @@ "eslint-plugin-eslint-plugin": "^6.3.2", "globals": "^15.1.0", "got": "^14.4.2", + "knip": "^5.61.3", "lint-staged": "^15.2.9", "mocha": "^11.6.0", "prettier": "^3.3.3", + "semver": "^7.7.2", "typescript": "^5.9.2", "yorkie": "^2.0.0" },