Skip to content

Commit 24f84b5

Browse files
committed
Fixes discovered during dogfooding
1 parent d100e7c commit 24f84b5

5 files changed

Lines changed: 28 additions & 16 deletions

File tree

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
],
3232
"scripts": {
3333
"release": "release-it",
34+
"prepare": "yarn build",
35+
"postpublish": "yarn clean",
3436
"build": "tsc",
3537
"clean": "tsc --build --clean",
3638
"fixme": "yarn build; codemod-cli test && node ./test/run-test.js && git checkout test/fixtures; yarn clean",
@@ -60,7 +62,7 @@
6062
"@babel/core": "^7.20.12",
6163
"@babel/eslint-parser": "^7.19.1",
6264
"@babel/preset-env": "^7.20.2",
63-
"@tsconfig/node-lts-strictest": "^18.12.1",
65+
"@tsconfig/node12": "^1.0.11",
6466
"@types/jscodeshift": "^0.11.6",
6567
"@typescript-eslint/eslint-plugin": "^5.48.1",
6668
"@typescript-eslint/parser": "^5.48.1",
@@ -79,7 +81,7 @@
7981
"typescript": "^4.9.4"
8082
},
8183
"engines": {
82-
"node": "10.* || 12.* || >= 14"
84+
"node": "12.* || >= 14"
8385
},
8486
"publishConfig": {
8587
"registry": "https://registry.npmjs.org"

transforms/helpers/ast.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* eslint-disable @typescript-eslint/no-empty-interface, jsdoc/require-jsdoc */
22

33
import type { Type } from 'ast-types/lib/types';
4+
import type { ExpressionKind } from 'ast-types/gen/kinds';
45
import type {
56
ASTNode,
67
ArrayExpression,
@@ -283,12 +284,7 @@ export function isEOIdentifierAction(u: unknown): u is EOIdentifierAction {
283284
}
284285

285286
export interface EOPropertySimple extends EOProperty {
286-
value:
287-
| ArrayExpression
288-
| Identifier
289-
| Literal
290-
| MemberExpression
291-
| ObjectExpression;
287+
value: ExpressionKind; // UNSAFE: We don't check this anywhere
292288
}
293289

294290
interface EOActionInfiniteCall extends CallExpression {

transforms/helpers/eo-prop/private/call-expression.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ export default class EOCallExpressionProp extends AbstractEOProp<EOPropertyWithC
4343
const modifiers = [getModifier(calleeObject)];
4444
while (
4545
'callee' in calleeObject &&
46-
calleeObject.callee.type === 'MemberExpression'
46+
calleeObject.callee.type === 'MemberExpression' &&
47+
calleeObject.callee.object.type === 'CallExpression'
4748
) {
48-
assert(calleeObject.callee.object.type === 'CallExpression');
4949
calleeObject = calleeObject.callee.object;
5050
modifiers.push(getModifier(calleeObject));
5151
}

tsconfig.json

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,26 @@
11
{
2-
"extends": "@tsconfig/node-lts-strictest/tsconfig.json",
2+
"extends": "@tsconfig/node12/tsconfig.json",
33
"compilerOptions": {
44
"paths": {
55
"*": ["./types/*"]
66
},
77
"checkJs": false,
88
"noEmitOnError": false,
9-
"skipLibCheck": true
9+
"skipLibCheck": false,
10+
11+
"strict": true,
12+
"forceConsistentCasingInFileNames": true,
13+
"allowUnusedLabels": false,
14+
"allowUnreachableCode": false,
15+
"exactOptionalPropertyTypes": true,
16+
"noFallthroughCasesInSwitch": true,
17+
"noImplicitOverride": true,
18+
"noImplicitReturns": true,
19+
"noPropertyAccessFromIndexSignature": true,
20+
"noUncheckedIndexedAccess": true,
21+
"noUnusedLocals": true,
22+
"noUnusedParameters": true,
23+
"importsNotUsedAsValues": "error"
1024
},
1125
"include": ["transforms/**/*"],
1226
"exclude": ["transforms/ember-object/__testfixtures__/**/*"]

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1526,10 +1526,10 @@
15261526
resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82"
15271527
integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==
15281528

1529-
"@tsconfig/node-lts-strictest@^18.12.1":
1530-
version "18.12.1"
1531-
resolved "https://registry.yarnpkg.com/@tsconfig/node-lts-strictest/-/node-lts-strictest-18.12.1.tgz#9d574cc30c5d90e4b4517b4b3833ba9ca2897c51"
1532-
integrity sha512-pn6cefRFlBVSEo5lO82bJnGmaptr90Wu8zCROkMUYXEz0f4AgCD65Guhq4u3PIuIlsYImaOmdoiHajx1gVTiQw==
1529+
"@tsconfig/node12@^1.0.11":
1530+
version "1.0.11"
1531+
resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.11.tgz#ee3def1f27d9ed66dac6e46a295cffb0152e058d"
1532+
integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==
15331533

15341534
"@types/babel__core@^7.0.0", "@types/babel__core@^7.1.14":
15351535
version "7.1.14"

0 commit comments

Comments
 (0)