Skip to content

Commit

Permalink
Set up knip
Browse files Browse the repository at this point in the history
  • Loading branch information
Jym77 committed Sep 2, 2024
1 parent 236df67 commit 2f8d16d
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 424 deletions.
1 change: 1 addition & 0 deletions .github/workflows/integrate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ jobs:
- run: yarn dedupe --check
- run: yarn build
- run: yarn test
- run: yarn knip
24 changes: 5 additions & 19 deletions config/knip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const entry = ["test/**/*.spec.ts", "test/**/*.spec.tsx"];
const project = ["**/*.ts", "**/*.tsx"];

const config: KnipConfig = {
ignoreDependencies: ["prettier"],
workspaces: {
common: { entry: "persist.ts", project },
"custom-testing/*": { entry, project },
Expand All @@ -23,30 +24,15 @@ const config: KnipConfig = {
},
"end-to-end-testing/webdriver": {
"webdriver-io": { config: ["wdio.conf.ts"], entry, project },
ignoreDependencies: [
// imported through the config file
"chromedriver",
],
},
"unit-testing/*": { entry, project },
"unit-testing/angular": { entry: ["components/*.ts", "setup.ts"], project },
"unit-testing/react": { entry: ["components/*.tsx", "setup.ts"], project },
"unit-testing/vue": { entry: ["components/*.ts", "setup.ts"], project },
// "packages/alfa-cascade": {
// entry,
// project,
// // For some reason, knip doesn't detect that Bucket is used in the test
// // file and needs to be exported for that.
// ignore: ["src/ancestor-filter.ts"],
// },
// "packages/alfa-device": { entry: [...entry, "src/native.ts!"], project },
// "packages/alfa-dom": {
// entry: [
// ...entry,
// "src/h.ts!",
// "src/jsx.ts!",
// "src/jsx-runtime.ts!",
// "src/native.ts!",
// ],
// project,
// },
// "packages/alfa-web": { entry: [...entry, "src/native.ts!"], project },
},
};

Expand Down
2 changes: 0 additions & 2 deletions custom-testing/answering/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
"@siteimprove/alfa-playwright": "^0.65.2",
"@siteimprove/alfa-refinement": "^0.81.0",
"@siteimprove/alfa-rules": "^0.81.0",
"@siteimprove/alfa-scraper": "^0.65.2",
"@siteimprove/alfa-style": "^0.81.0",
"@types/chai": "^4.2.3",
"@types/mocha": "^5.2.7",
"chai": "^4.3.4",
Expand Down
2 changes: 0 additions & 2 deletions end-to-end-testing/playwright/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
"test": "mocha --timeout 10000"
},
"devDependencies": {
"@siteimprove/alfa-assert": "^0.65.2",
"@siteimprove/alfa-chai": "^0.65.2",
"@siteimprove/alfa-formatter-earl": "^0.65.2",
"@siteimprove/alfa-future": "^0.81.0",
"@siteimprove/alfa-playwright": "^0.65.2",
"@siteimprove/alfa-rules": "^0.81.0",
Expand Down
1 change: 0 additions & 1 deletion end-to-end-testing/puppeteer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"test": "mocha -t 10000"
},
"devDependencies": {
"@siteimprove/alfa-assert": "^0.65.2",
"@siteimprove/alfa-chai": "^0.65.2",
"@siteimprove/alfa-future": "^0.81.0",
"@siteimprove/alfa-puppeteer": "^0.65.2",
Expand Down
4 changes: 0 additions & 4 deletions end-to-end-testing/webdriver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,19 @@
"test": "wdio wdio.conf.js"
},
"devDependencies": {
"@siteimprove/alfa-assert": "^0.65.2",
"@siteimprove/alfa-chai": "^0.65.2",
"@siteimprove/alfa-future": "^0.81.0",
"@siteimprove/alfa-rules": "^0.81.0",
"@siteimprove/alfa-webdriver": "^0.65.2",
"@types/chai": "^4.2.3",
"@types/mocha": "^5.2.7",
"@wdio/cli": "^5.14.4",
"@wdio/local-runner": "^7.1.1",
"@wdio/mocha-framework": "^7.1.1",
"@wdio/spec-reporter": "^7.1.1",
"chai": "^4.3.4",
"chromedriver": "^119.0.1",
"common": "workspace:^",
"mocha": "^8.3.2",
"ts-node": "^9.1.1",
"wdio-chromedriver-service": "^7.0.0",
"webdriverio": "^7.3.1"
}
}
1 change: 0 additions & 1 deletion unit-testing/angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
},
"devDependencies": {
"@siteimprove/alfa-angular": "^0.65.2",
"@siteimprove/alfa-assert": "^0.65.2",
"@siteimprove/alfa-future": "^0.81.0",
"@siteimprove/alfa-jest": "^0.65.2",
"@siteimprove/alfa-rules": "^0.81.0",
Expand Down
1 change: 0 additions & 1 deletion unit-testing/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
]
},
"devDependencies": {
"@siteimprove/alfa-assert": "^0.65.2",
"@siteimprove/alfa-enzyme": "^0.65.2",
"@siteimprove/alfa-jest": "^0.65.2",
"@siteimprove/alfa-rules": "^0.81.0",
Expand Down
1 change: 0 additions & 1 deletion unit-testing/vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"vue-template-compiler": "^2.6.12"
},
"devDependencies": {
"@siteimprove/alfa-assert": "^0.65.2",
"@siteimprove/alfa-future": "^0.81.0",
"@siteimprove/alfa-jest": "^0.65.2",
"@siteimprove/alfa-rules": "^0.81.0",
Expand Down
Loading

0 comments on commit 2f8d16d

Please sign in to comment.