Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions knip.json
Original file line number Diff line number Diff line change
@@ -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"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar with Knip, but I tried adding a file unused.js at the repo root, and Knip did not report it.

> @eslint/[email protected] lint:unused
> knip

✂️  Excellent, Knip found no issues.

It did report it, however, if project was changed to include all files.

Suggested change
"project": ["src/**/*.js", "src/**/*.ts"]
"project": ["**"]
> @eslint/[email protected] lint:unused
> knip

Unused files (1)
unused.js

},
"examples/*": {
"entry": ["**/*.*s"]
}
Comment on lines +8 to +10
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this is necessary. If so, Knip suggests overriding project when entry is overridden: https://knip.dev/overview/configuration#customize.

}
}
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -70,22 +71,26 @@
"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",
"eslint-config-eslint": "^11.0.0",
"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"
},
Expand Down
Loading