All notable changes to this project will be documented in this file.
- Updated to support TypeScript 5.0, dropped support for TypeScript versions <4.4.4.
- Added the ability to emit 'index entries'. (#271)
- Fixed import issue in lit-analyzer CLI.
- Dropped support for older versions of NodeJS. Minimum version is Node 16.
- Markdown output is no properly escaped (#119)
- Code fixes now works again in Webstorm (rule ids now start at 2300) (#124)
- Fixed CSS auto completion (#120)
- 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 theHTMLElementTagNameMap
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;
}
- Added autocompletion for CSS shadow parts and CSS custom properties in CSS. It's possible to document those using JSDoc (dd1ffc78)
- The role and controlslist attributes are now correctly type checked (#89)
Example:
/**
* @cssprop {Color} --border-color - Sets the color of the border
* @csspart content - The content of my element
*/
class MyElement extends HTMLElement {
}
- 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)
- 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
- New rule:
no-legacy-attribute
which is disabled as default. A common mistake when dealing with Lit in particular is to use the legacy Polymer syntax as seen in earlier versions of Polymer (the predecessor of Lit). This rule catches this mistake (see #95) - Added closure security safe type for
<source src>
(see #88) - Fixed typo about event type detection (see #86)
- Better performance when using the
no-missing-imports
rule.lit-analyzer
will still check imported modules in your project as usual, however, it will only follow imports 2 levels deep into any imported module from an external dependency (see #93) - The CLI-option
maxWarnings
defaults to-1
to avoid failing when the analysis found only warnings (see #96)
- Added basic support for type checking code with Safe Types sanitization in place (#62)
- VSCode parameter hints for html/css tagged template literal are now hidden (#61)
- Fixed css list substitution bug (#76)
- Fixed problem where when input type is date, min and max should accept date string (#77)
- Fixed
no-boolean-in-attribute-binding
to allow assigning booleans that are coerced to string to 'true'|'false' where appropriate (#dc6cdc6db)
- New rule
no-unintended-mixed-binding
to prevent bugs like<input value=${"foo"}} />
(#44) - Hex colors within html/css templates are now highlighted in the vscode plugin (#30)
- Big internal refactor, including adding a lot of tests (#49)
- Fixed problem where closing tags weren't auto-completed properly (#37cba351)
- Fixed problem where lit-analyzer would crash when running with a newer version of Typescript (#58)
- Fix problem where the value of attributes on the form attr='val' could get parsed incorrectly. (#36)
-
Some rules are disabled as default to give users a smoother on-boarding experience. To re-enable the stricter rules please set "strict: true". Consult the documentation for more information.
-
Functionality has been refactored into "rules" which can be enabled and disabled individually. It should now be much clearer how to enabled or disable individual functionality. Consult the documentation for more information.
-
When using the @property decorator from "lit-element" the type of "{type: ...}" is checked against the actual property type.
-
Support for using components built with mixins
-
Warning when using boolean type expression in attribute binding (#15)
-
Allow "null" and "undefined" as values always when using "?" attr binding (#16)
-
Suggested code fix: Please use the
ifDefined
directive. (#17) -
The usage of built-in directives is now checked to make sure that they are used correctly.
-
Experimental: It's now possible to refactor custom element tag names.
-
The analyzer has been updated and should now be much more robust (see web-component-analyzer).
-
The type checker has been updated and should now be much more robust (see ts-simple-type).
- Added support for
observedAttributes
,properties
andjsdoc comments
as well as web component libraries built with stencil. - 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 myslot
jsdoc. - 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@fires myevent
jsdoc. - 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 code folding
- Added support for vscode custom html data format.
- Support for declaring attributes and properties using
@attr myattr
and@prop myprop
jsdoc. - CSS autocompletion now includes all custom element tag names available.
- The web component analyzer is now much more stable and won't crash on strange inputs.
- Temporarily disabled code formatting until issues with nested templates are solved.
- Added code completions and diagnostics for the
CSS
tagged template and<style>
tag. - Added check for non-callable types given to event listeners in order to catch errors like
@click="myHandler()"
. - More reliable type checking across all assignments.
- Better support for built in tag names and global attributes. These now directly use data from the vscode html language service.
- Values are now auto completed for attribute assignments where possible. For example an attribute with a string union type
"large" | "small"
will suggest these values. - Inline documentation is now shown when listing completions.
- Fixed issue where components from libraries would be imported as
import "../../node_modules/my-component"
and notimport "my-component"
- Added various missing global built in elements.
- Added various missing global built in attributes like 'aria-*' attributes.
- Added support for
@ts-ignore
comments (#2) - Added reformat support
- Added support for libraries that extend the global
HTMLElementTagNameMap
- Fixed broken auto-close tag functionality