Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/lit-analyzer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
"fast-glob": "^2.2.6",
"parse5": "5.1.0",
"ts-simple-type": "~1.0.5",
"vscode-css-languageservice": "4.3.0",
"vscode-html-languageservice": "3.1.0",
"vscode-css-languageservice": "4.4.0",
"vscode-html-languageservice": "3.2.0",
"web-component-analyzer": "~1.1.1"
},
"devDependencies": {
Expand All @@ -67,7 +67,7 @@
"typescript-3.7": "npm:typescript@~3.7.4",
"typescript-3.8": "npm:typescript@~3.8.3",
"typescript-3.9": "npm:typescript@~3.9.3",
"vscode-web-custom-data": "0.3.0"
"vscode-web-custom-data": "0.3.4"
},
"ava": {
"cache": true,
Expand Down
10 changes: 10 additions & 0 deletions packages/lit-analyzer/test/rules/no-incompatible-type-binding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,16 @@ tsTest("Attribute binding: Boolean type expression (false) is assignable to 'tru
hasNoDiagnostics(t, diagnostics);
});

tsTest("Attribute binding: Non boolean expression (dialog) is assignable to aria-haspopup", t => {
const { diagnostics } = getDiagnostics('html`<input aria-haspopup="dialog" />`');
hasNoDiagnostics(t, diagnostics);
});

tsTest("Attribute binding: Random string literal is not assignable to aria-haspopup", t => {
const { diagnostics } = getDiagnostics('html`<input aria-haspopup="test" />`');
hasDiagnostic(t, diagnostics, "no-incompatible-type-binding");
});

tsTest("Attribute binding: Union of 'string | Directive' type expression is assignable to string", t => {
const { diagnostics } = getDiagnostics('type DirectiveFn = {}; html`<input placeholder="${{} as string | DirectiveFn}" />`');
hasNoDiagnostics(t, diagnostics);
Expand Down