Skip to content

Commit 40e8ecc

Browse files
committed
Check types with glint
1 parent 69509ae commit 40e8ecc

File tree

8 files changed

+126
-4
lines changed

8 files changed

+126
-4
lines changed

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ public-hoist-pattern[]=*eslint*
33
public-hoist-pattern[]=@typescript-eslint/*
44
public-hoist-pattern[]=*ember-template-lint*
55
public-hoist-pattern[]=*stylelint*
6+
public-hoist-pattern[]=*@glint*

ember-element-helper/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"lint:fix": "concurrently 'npm:lint:js:fix'",
3838
"lint:js": "eslint . --cache",
3939
"lint:js:fix": "eslint . --fix",
40+
"lint:types": "glint",
4041
"start": "concurrently 'npm:start:*'",
4142
"start:js": "rollup -c --watch --no-watch.clearScreen",
4243
"start:types": "tsc --emitDeclarationOnly -w",
@@ -57,6 +58,8 @@
5758
"@babel/preset-typescript": "7.22.5",
5859
"@babel/runtime": "7.22.6",
5960
"@embroider/addon-dev": "4.1.0",
61+
"@glimmer/component": "^1.1.2",
62+
"@glint/core": "1.0.2",
6063
"@glint/template": "1.0.2",
6164
"@glint/environment-ember-loose": "1.0.2",
6265
"@nullvoxpopuli/eslint-configs": "2.2.36",

ember-element-helper/tsconfig.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
11
{
22
"extends": "@tsconfig/ember/tsconfig.json",
3+
"glint": {
4+
"environment": [
5+
"ember-loose",
6+
"ember-template-imports"
7+
]
8+
},
39
"compilerOptions": {
410
"noEmit": false,
511
"declarationDir": "./declarations",
612
"paths": {
713
"*": [
814
"./types/*"
915
]
10-
}
16+
},
17+
// for typescript < 5
18+
"moduleResolution": "NodeNext"
1119
},
1220
"include": [
1321
"src/**/*",

pnpm-lock.yaml

Lines changed: 103 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{{#let @tag as |Tag|}}
2+
{{!@glint-ignore}}
23
<Tag id="content" ...attributes>{{yield}}</Tag>
34
{{/let}}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Component from '@glimmer/component';
22
import type { ElementSignature, ElementFromTagName } from 'ember-element-helper';
33

4-
interface ElementReceiverSignature<T extends string> {
4+
interface ElementReceiverSignature<T extends string = 'article'> {
55
Element: ElementFromTagName<T>;
66
Args: {
77
tag: ElementSignature<T>['Return'];
@@ -11,4 +11,4 @@ interface ElementReceiverSignature<T extends string> {
1111
}
1212
}
1313

14-
export default class ElementReceiver<T extends string = 'article'> extends Component<ElementReceiverSignature<T>> {}
14+
export default class ElementReceiver<T extends string> extends Component<ElementReceiverSignature<T>> {}

test-app/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"lint:fix": "concurrently 'npm:lint:*:fix' --names 'fix:'",
1919
"lint:js": "eslint . --cache",
2020
"lint:js:fix": "eslint . --fix",
21+
"lint:types": "glint",
2122
"start": "ember serve",
2223
"test": "ember test"
2324
},
@@ -47,6 +48,8 @@
4748
"@glint/environment-ember-template-imports": "^1.0.2",
4849
"@glint/template": "^1.0.2",
4950
"@tsconfig/ember": "^3.0.0",
51+
"@typescript-eslint/eslint-plugin": "^5.62.0",
52+
"@typescript-eslint/parser": "^5.62.0",
5053
"broccoli-asset-rev": "^3.0.0",
5154
"concurrently": "^8.0.1",
5255
"ember-auto-import": "^2.6.3",
@@ -65,6 +68,7 @@
6568
"ember-resolver": "^10.0.0",
6669
"ember-source": "~4.12.0",
6770
"ember-source-channel-url": "^3.0.0",
71+
"ember-template-imports": "^3.4.2",
6872
"ember-template-lint": "^5.7.2",
6973
"ember-try": "^2.0.0",
7074
"eslint": "^8.37.0",

test-app/tsconfig.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
"*": [
2222
"types/*"
2323
]
24-
}
24+
},
25+
// for typescript < 5
26+
"moduleResolution": "NodeNext"
2527
},
2628
"include": [
2729
"app/**/*",

0 commit comments

Comments
 (0)