All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
- Accept AnalysisOptions as an argument to
Linter#lint
andLinter#lintPackage
.
- Adds the new rule
iron-form-v1-to-v2
, which warns aboutiron-form
being used as a type extension of<form>
.- The fix automatically wraps the
<form is="iron-form">
into an<iron-form>
and movesid
,with-credentials
,headers
properties andon-iron-form-*
events from<form>
to<iron-form>
.
- The fix automatically wraps the
create-element-extension
: Warns when using the second parameter ofcreateElement
for element extension using theis
attribute.validate-element-name
: Warns when using an invalid element name or when there are potential issues or conflicts with the element name.root-selector-to-html
: Warns when using the:root
selector incustom-style
or element styles.custom-style-extension
: Warns when<style>
is extended byis="custom-style"
but not wrapped by<custom-style>
.
content-selector-to-slotted
: Don't attempt to fix usages where a selector would come after::slotted
- Make
dom-module-invalid-attrs
rule fixable for cases where onlyis
orname
exist, and both if they use the same values.
dom-calls-to-native
: Warns whenPolymer.dom
is used where native methods/properties maydeprecated-shadow-dom-selectors
: Warns when deprecated Shadow DOM selectors are used. (/deep/
,>>>
, and::shadow
)content-selector-to-slotted
: Warns when deprecated::content
selector is used. Can safely fix usages that use>
selector.
- [BREAKING] Return an object with
warnings
andanalysis
properties rather than an array or warnings with an unenumerableanalysis
property. - Add an explicit dependency on shady-css-parser. This fixes a bug where it is not always found, despite being a dependency of polymer-analyzer.
- Add a test for the
content-to-slot-usages
rule's updates to children of<paper-icon-item>
. - Improved compatibility with Windows. Added Windows CI with appveyor.
- Adds the
paper-toolbar-v1-to-v2
rule, which helps upgrade uses of paper-toolbar from v1 to v2 (hybrid) by adding slots to children where appropriate. - Improve the wording on the content-to-slot-declaration's unsafe edit action.
- The array of warnings returned by
Linter#lint()
andLinter#lintPackage()
now also has a non-enumerableanalysis
property, which refers to the immutableAnalysis
used to generate the lint results. - Fixed
iron-flex-layout-classes
to handleclass$
attribute.
- Added a concept of edit actions, which are like fixes with caveats. These need explicit user intent to apply because they may change the code's API, or otherwise be unsafe.
- Support warning about and automatically fixing some simple uses of some 1.0 elements to their 2.0 usage styles.
- To add this fixable lint warning for your own elements, simply add the
old-content-selector
attribute to your new<slot>
element. Set its value to the value that your old<content>
element had for itsselect
attribute.- e.g. if you had
<content select=".some-content">
and migrated to<slot name="new-content" old-content-selector=".some-content">
then the linter will warn about and addslot="new-content"
to children of your element that match.some-content
.
- e.g. if you had
- To add this fixable lint warning for your own elements, simply add the
- Support warning about and automatically fixing/editing element declarations that use
<content>
to use<slot>
instead.- It automatically adds the
old-content-selector
attribute to migrated<slot>
elements, so uses can be automatically upgraded as well.
- It automatically adds the
- Support automatic fixing of the warning where a
<style>
element is a direct child of a dom-module's<template>
. - Support warning about and fixing usage of deprecated
iron-flex-layout/classes/*
files via the new ruleiron-flex-layout-import
- It automatically adds, updates, or deletes the import
iron-flex-layout/iron-flex-layout-classes.html
.
- It automatically adds, updates, or deletes the import
- Support warning about and fixing usage of iron-flex-layout classes without including the required style modules via the new rule
iron-flex-layout-classes
- It automatically upgrades the element template to include the iron-flex-layout style modules.
- Warn for old-style @apply without parentheses, and var() with a fallback value of a bare css variable.
- These are our first automatically fixable warnings. An upcoming version of the CLI and IDE will be able to automatically fix these warnings.
- Fix handling of the
index-as
attribute on dom-repeat.
- Upgraded dependency
polymer-analyzer
to ^2.0.0, to support its official release.
- Upgraded dependency
polymer-analyzer
to 2.0.0-alpha.42, providing better method privacy inference, support for new JSDoc tags including those in HTML comments for custom elements, and better warnings for mixins, elements, and classes.
- [BREAKING] Dropped support for node v4, added support for node v8. See our node version support policy for details.
- Fixed a number of issues with standalone javascript files referenced via
<script src="./foo.js">
. We now more reliably know about the context of the HTML in which they are imported, so that their dependencies are properly resolved.
- Minor dependency bump.
- Fix a bug where we were including warnings from dependencies when linting a package.
- polymer-lint is now at feature parity with polylint, and is ready to replace it!
databind-with-unknown-property
: Warns when a polymer element's databindings use properties that aren't declared on that element.element-before-dom-module
: Warns when a Polymer element is defined before its<dom-module>
exists in the DOM.databinding-calls-must-be-functions
: Computed functions, observers, and calls in databinding expressions must be either methods on the element or properties with types that could be function types.call-super-in-callbacks
: Warns when a Polymer 2.0 element does not call super() in callbacks that require it, likeconnectedCallback
.
set-unknown-attribute
- We weren't checking bindings on imported elements.
- Warning for unknown attributes has too many false positives to be on by default. There are too many legit use cases for adding arbitrary attributes to elements. We'll add it as an option once we've got lint rule options hooked up.
- Update polymer-analyzer to 1.0.0-alpha.31
behaviors-spelling
: Warns when thebehaviors
property may not have the American-English spellingundefined-elements
: Warns when an HTML tag refers to a custom element with no known definition.unbalanced-polymer-delimiters
: finds unbalanced delimiters in polymer databinding expressions.unknown-set-attribute
: included in all polymer rule collections.-
Warns when setting undeclared properties or attributes in HTML.
This rule will check use of attributes in HTML on custom elements, as well as databinding into attributes and properties in polymer databinding contexts.
This catches misspellings, forgetting to convert camelCase to kebab-case, and binding to attributes like class and style like they were properties.
Currently only checks custom elements, as we don't yet have the necessary metadata on native elements in a convenient format.
-
- bump version of the analyzer.
- bump version of the analyzer.
- allRules and allRuleCollections on the registry, for accessing all registered rules and collections.
- The start of our rewrite of https://github.com/PolymerLabs/polylint on top of our new incremental static analysis framework.
- APIs for both linting by files and by package.
- Rule collections. Semantic, intent-based collections of lint rules.
- A queryable, extensible registry of rules and rule collections.
- Rule that warns about
<style>
tags as direct children of<dom-module>
tags (rather than being in<template>
tags). - Rule that warns about
is
andname
attributes on<dom-module>
tags.