Skip to content

Commit

Permalink
build: migrate from depcheck to knip (scolladon#837)
Browse files Browse the repository at this point in the history
  • Loading branch information
scolladon authored Apr 18, 2024
1 parent 71eb82f commit a86a6ff
Show file tree
Hide file tree
Showing 6 changed files with 991 additions and 389 deletions.
12 changes: 0 additions & 12 deletions .depcheckrc

This file was deleted.

3 changes: 1 addition & 2 deletions .github/linters/.cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@
"customindex",
"datacategorygroup",
"datacategorygroups",
"depcheck",
"depcheckrc",
"destructiveignore",
"destructiveinclude",
"emailservices",
Expand Down Expand Up @@ -69,6 +67,7 @@
"indx",
"infile",
"knip",
"knip",
"lcov",
"linebreak",
"lintstagedrc",
Expand Down
19 changes: 19 additions & 0 deletions knip.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import type { KnipConfig } from 'knip'

const config = async (): Promise<KnipConfig> => {
return {
entry: ['src/commands/sgd/source/delta.ts', 'src/main.ts'],
project: ['src/**/*.ts'],
ignoreDependencies: [
'@salesforce/ts-sinon',
'@types/jest',
'@types/mocha',
'chai',
'mocha',
'sinon',
],
ignoreBinaries: ['test:e2e'],
}
}

export default config
18 changes: 11 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"test:build": "yarn clean ; shx rm -rf .yarn/cache node_modules ; yarn && yarn pack && yarn test",
"test:mutation": "wireit",
"test:nut": "wireit",
"test:perf": "node __tests__/perf/bench.mjs | tee perf-result.txt",
"test:perf": "node __tests__/perf/bench.mjs > perf-result.txt && shx cat perf-result.txt",
"test:unit": "wireit",
"test:unit:debug": "node --inspect node_modules/.bin/jest",
"test:unit:debug:break": "node --inspect-brk node_modules/.bin/jest",
Expand Down Expand Up @@ -108,15 +108,18 @@
"output": []
},
"lint:dependencies": {
"command": "depcheck",
"command": "knip",
"files": [
"src/**/*.ts",
"test/**/*.ts",
"messages/**",
"**/tsconfig.json",
".depcheckrc"
"knip.config.ts"
],
"output": []
"output": [],
"dependencies": [
"lint"
]
},
"test": {
"dependencies": [
Expand Down Expand Up @@ -184,18 +187,18 @@
"@types/async": "^3.2.24",
"@types/jest": "^29.5.12",
"@types/mocha": "^10.0.6",
"@types/node": "^20.11.28",
"@types/node": "^20.12.7",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
"benchmark": "^2.1.4",
"chai": "^4.3.10",
"depcheck": "^1.4.7",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-prettier": "^5.1.3",
"husky": "^9.0.11",
"jest": "^29.7.0",
"knip": "^5.9.4",
"lint-staged": "^15.2.2",
"mocha": "^10.3.0",
"nyc": "^15.1.0",
Expand All @@ -204,7 +207,8 @@
"sinon": "^17.0.1",
"ts-jest": "^29.1.2",
"ts-node": "^10.9.2",
"typescript": "^5.4.2",
"tslib": "^2.6.2",
"typescript": "^5.4.5",
"wireit": "^0.14.4",
"yarn-audit-fix": "^10.0.7",
"yarn-upgrade-all": "^0.7.2"
Expand Down
6 changes: 0 additions & 6 deletions src/constant/gitConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,4 @@ export const DELETION = 'D'
export const MODIFICATION = 'M'
export const GIT_DIFF_TYPE_REGEX = /^.\s+/u
export const GIT_FOLDER = '.git'
export const IGNORE_WHITESPACE_PARAMS = [
'--ignore-all-space',
'--ignore-blank-lines',
'--ignore-cr-at-eol',
'--word-diff-regex=|[^[:space:]]',
]
export const UTF8_ENCODING = 'utf8'
Loading

0 comments on commit a86a6ff

Please sign in to comment.