Releases: runem/lit-analyzer
Releases · runem/lit-analyzer
v1.2.0
Added
- Added new rule
no-property-visibility-mismatch. This rule will ensure public properties use@propertyand non-public properties use@internalProperty(#100) - Added new rule
no-missing-element-type-definitionThis rule will ensure that custom elements are registered on the
HTMLElementTagNameMapTypescript 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
-1is 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
HTMLElementTagNameMapit's now also possible extend theHTMLElementEventMapinterface and theHTMLElementinterface (#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-bindingnow 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-converterhas been removed andno-incompatible-property-typecan 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-analyzernow uses data fromvscode-web-custom-datacancellationTokenis now supported to prevent long running operations
v1.0.0
Added
- Added support for
observedAttributes,propertiesandjsdoc commentsas well as web component libraries built with stencil. For more information see the library: web-component-analyzer. - Autocompletion and type checking for properties. Properties on built in elements are supported.
- Autocompletion and name checking for slots. Add slots to your component using
@slot myslotjsdoc. - Autocompletion and name checking for events.
new CustomEvent("myevent")in the component is found automatically or you can choose to add events to your component using@event myeventjsdoc. - Added check for using the property modifier without an expression, as this is not support by lit-html, to catch errors like
.myProp="hello". - Added support for vscode custom html data format.
- Added support for declaring attributes and properties using
@attr myattrand@prop mypropjsdoc. - CSS autocompletion now includes all custom element tag names available.
Fixed
- The web component analyzer is now much more stable and won't crash on strange inputs.
Removed
- Temporarily disabled code formatting until issues with nested templates are solved.