Skip to content

Commit f2bd703

Browse files
committed
Type-check transform files
1 parent b29af71 commit f2bd703

5 files changed

Lines changed: 337 additions & 114 deletions

File tree

.github/workflows/tests.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ jobs:
1010
timeout-minutes: 15
1111

1212
steps:
13-
- uses: actions/checkout@v1
14-
- uses: actions/setup-node@v1
13+
- uses: actions/checkout@v3
14+
- uses: actions/setup-node@v3
1515
with:
16-
node-version: '10.x'
16+
node-version: '16.x'
1717
- name: Install
1818
run: yarn install
1919
- name: Linting
@@ -30,10 +30,10 @@ jobs:
3030
timeout-minutes: 15
3131

3232
steps:
33-
- uses: actions/checkout@v1
34-
- uses: actions/setup-node@v1
33+
- uses: actions/checkout@v3
34+
- uses: actions/setup-node@v3
3535
with:
36-
node-version: '10.x'
36+
node-version: '16.x'
3737
- name: Install
3838
run: yarn install
3939
- name: Test

package.json

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,16 @@
1414
"author": "",
1515
"scripts": {
1616
"release": "release-it",
17+
"prepublishOnly": "yarn build",
18+
"postpublish": "yarn clean",
19+
"build": "tsc",
20+
"clean": "tsc --build --clean",
1721
"test": "jest",
1822
"test:integration": "ts-node ./test/run-test.ts",
1923
"update-docs": "codemod-cli update-docs",
2024
"coveralls": "cat ./coverage/lcov.info | node node_modules/.bin/coveralls",
2125
"lint:js": "eslint .",
26+
"lint:ts": "tsc --noEmit",
2227
"debug:telemetry": "node --inspect-brk ./bin/telemetry.js",
2328
"debug:codemod:not-working": "node --inspect-brk ./bin/cli",
2429
"codemod": "jscodeshift -t ./transforms/no-implicit-this/index.js --extensions js,ts,hbs --run-in-band",
@@ -37,10 +42,13 @@
3742
"ember-template-recast": "^3.3.2"
3843
},
3944
"devDependencies": {
45+
"@tsconfig/node16": "^1.0.4",
46+
"@tsconfig/strictest": "^2.0.1",
4047
"@types/chalk": "^2.2.0",
4148
"@types/common-tags": "^1.8.0",
42-
"@typescript-eslint/eslint-plugin": "^2.34.0",
43-
"@typescript-eslint/parser": "^2.34.0",
49+
"@types/node": "^20.2.3",
50+
"@typescript-eslint/eslint-plugin": "^5.59.7",
51+
"@typescript-eslint/parser": "^5.59.7",
4452
"babel-plugin-htmlbars-inline-precompile": "^3.0.1",
4553
"chalk": "^4.1.1",
4654
"common-tags": "^1.8.0",
@@ -53,11 +61,11 @@
5361
"prettier": "^1.19.1",
5462
"release-it": "^14.6.2",
5563
"release-it-lerna-changelog": "^3.1.0",
56-
"ts-node": "^8.10.2",
57-
"typescript": "~3.9.7"
64+
"ts-node": "^10.9.1",
65+
"typescript": "~5.0.4"
5866
},
5967
"engines": {
60-
"node": "8.* || 10.* || >= 12"
68+
"node": "16.* || 18.* || >= 20"
6169
},
6270
"jest": {
6371
"testEnvironment": "node",

test/run-test.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { runTestIntegrationSequence } from './helpers/sequence';
77

88
const allVersions = ['3.10', '3.13'];
99

10-
(async () => {
10+
(async (): Promise<void> => {
1111
const emberVersion = process.env.EMBER_VERSION;
1212

1313
if (!emberVersion) {
@@ -31,7 +31,7 @@ const allVersions = ['3.10', '3.13'];
3131

3232
didSucceed = false;
3333
} finally {
34-
// TOOD: if there were any changes to the fixtures directories, revert them
34+
// TODO: if there were any changes to the fixtures directories, revert them
3535
try {
3636
// const fixturePath = path.join(process.cwd(), 'test', 'fixtures', emberVersion);
3737
// await execa(`git checkout -- .`, { cwd: fixturePath });
@@ -44,4 +44,7 @@ const allVersions = ['3.10', '3.13'];
4444
}
4545

4646
process.exit(didSucceed ? 0 : 1);
47-
})();
47+
})().catch(e => {
48+
console.error(e);
49+
process.exit(1);
50+
});

tsconfig.json

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
{
2+
"extends": ["@tsconfig/node16/tsconfig.json", "@tsconfig/strictest/tsconfig.json"],
23
"compilerOptions": {
3-
"module": "commonjs",
4-
"esModuleInterop": true,
5-
"allowSyntheticDefaultImports": true,
6-
"target": "es6",
7-
"noImplicitAny": true,
8-
"moduleResolution": "node",
94
"sourceMap": true,
5+
// FIXME: "skipLibCheck": false,
106
"outDir": "dist",
117
"baseUrl": ".",
128
"paths": {
13-
"*": ["node_modules/*", "types/*"]
9+
"*": ["types/*"]
1410
}
1511
},
16-
"include": ["test/**/*"]
12+
"include": ["transforms/**/*", "test/**/*"]
1713
}

0 commit comments

Comments
 (0)