Skip to content

Commit fa1a8a3

Browse files
gitKrystanmansona
authored andcommitted
Fix type-checking errors
1 parent cc7b94e commit fa1a8a3

23 files changed

+1247
-1358
lines changed

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,10 @@ node_modules
33
tmp
44
*.log
55
test/**/yarn.lock
6+
test/**/*.js
7+
test/**/*.js.map
8+
transforms/**/*.js
9+
transforms/**/*.js.map
10+
helpers/**/*.js
11+
helpers/**/*.js.map
12+
!**/__testfixtures__/**/*

helpers/types.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/** Type predicate. Checks if the given value is a `Record<string, unknown>`. */
2+
export function isRecord<R extends Record<string, unknown>>(
3+
value: unknown
4+
): value is R {
5+
return value !== null && typeof value === 'object';
6+
}

package.json

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
"bin": {
1919
"ember-no-implicit-this-codemod": "./bin/cli.js"
2020
},
21+
"files": [
22+
"/bin",
23+
"/helpers/**/*.js",
24+
"/transforms/no-implicit-this/index.js",
25+
"/transforms/no-implicit-this/helpers/**/*.js"
26+
],
2127
"scripts": {
2228
"build": "tsc",
2329
"clean": "tsc --build --clean",
@@ -27,30 +33,36 @@
2733
"debug:codemod:not-working": "node --inspect-brk ./bin/cli",
2834
"debug:telemetry": "node --inspect-brk ./bin/telemetry.js",
2935
"lint:js": "eslint .",
30-
"test": "jest",
3136
"lint:ts": "tsc --noEmit",
32-
"postpublish": "yarn clean",
3337
"prepublishOnly": "yarn build",
38+
"release": "release-it",
39+
"test": "jest",
40+
"pretest:integration": "yarn build",
3441
"test:integration": "ts-node ./test/run-test.ts",
3542
"update-docs": "codemod-cli update-docs"
3643
},
3744
"jest": {
45+
"preset": "ts-jest",
3846
"testEnvironment": "node",
3947
"testMatch": [
40-
"<rootDir>/transforms/**/test.js"
48+
"<rootDir>/transforms/**/test.{js,ts}"
4149
]
4250
},
4351
"dependencies": {
44-
"codemod-cli": "^2.1.0",
52+
"@babel/core": "^7.21.8",
53+
"@babel/preset-env": "^7.21.5",
54+
"codemod-cli": "^3.2.0",
4555
"debug": "^4.1.1",
4656
"ember-codemods-telemetry-helpers": "^3.0.0",
47-
"ember-template-recast": "^3.3.2"
57+
"ember-template-recast": "^6.1.4"
4858
},
4959
"devDependencies": {
5060
"@tsconfig/node16": "^1.0.4",
5161
"@tsconfig/strictest": "^2.0.1",
5262
"@types/chalk": "^2.2.0",
5363
"@types/common-tags": "^1.8.0",
64+
"@types/debug": "^4.1.8",
65+
"@types/jscodeshift": "^0.11.6",
5466
"@types/node": "^20.11.5",
5567
"@typescript-eslint/eslint-plugin": "^5.59.7",
5668
"@typescript-eslint/parser": "^5.59.7",
@@ -62,9 +74,10 @@
6274
"eslint-config-prettier": "^6.15.0",
6375
"eslint-plugin-prettier": "^3.4.0",
6476
"execa": "^3.4.0",
65-
"jest": "^26.6.3",
77+
"jest": "^29.1.0",
6678
"prettier": "^1.19.1",
6779
"release-plan": "^0.6.0",
80+
"ts-jest": "^29.1.0",
6881
"ts-node": "^10.9.1",
6982
"typescript": "~5.0.4"
7083
},

0 commit comments

Comments
 (0)