Added
- Added new rule
no-property-visibility-mismatch
. This rule will ensure public properties use@property
and non-public properties use@internalProperty
(#100) - Added new rule
no-missing-element-type-definition
This rule will ensure that custom elements are registered on the
HTMLElementTagNameMap
Typescript interface (#73) - It's now possible to configure how many modules deep dependencies are followed to determine whether a custom element is available in the current file. When
-1
is used, dependencies will be followed infinitely deep. This can be configured for both external dependencies and project dependencies withmaxNodeModuleImportDepth
&maxProjectImportDepth
(#116) - In addition to extending
HTMLElementTagNameMap
it's now also possible extend theHTMLElementEventMap
interface and theHTMLElement
interface (#53)
Example:
declare global {
interface HTMLElementTagNameMap {
"my-element": HTMLElement;
}
interface HTMLElementEventMap {
"my-event": Event;
}
}
/**
* @attr my-attr
*/
interface HTMLElement {
myProperty: string;
}
- The role and controlslist attributes are now correctly type checked (#89)
- Added autocompletion for CSS shadow parts and CSS custom properties in CSS. It's possible to document those using JSDoc (dd1ffc78)
Example:
/**
* @cssprop {Color} --border-color - Sets the color of the border
* @csspart content - The content of my element
*/
class MyElement extends HTMLElement {
}
Fixed and changed
- Quick fix for missing imports now generates correct path on Windows (#110)
- Type checking is now up to 15 times faster
is-assignable-in-boolean-binding
now also accepts "null" and "undefined" types in boolean bindings. Example:<input ?required="${undefined}" />
- "Fix message" is now included in the output for the CLI -
no-unknown-property-converter
has been removed andno-incompatible-property-type
can be used instead. - Improved JSDoc support
- Improved mixin support
- Private and protected members are now also analyzed
- All diagnostics in vscode are now reported as
lit-plugin([RULE_ID])
and have unique diagnostic codes (#108) - When resolving imports for a given module, facade modules are always followed and do not increase depth (#114)
- Improve codefix for 'no-missing-import' rule (#117)
Project
- Refactoring of rule modules
- Added more tests
lit-analyzer
now uses data fromvscode-web-custom-data
cancellationToken
is now supported to prevent long running operations