Repository navigation
v1.8.2
Patch Changes
-
#92
7328196Thanks @tenphi! -no-style-prop,no-classname-prop,no-styles-propand the Tasty-component gate for JSX value rewrites recognize Tasty components imported from relative modules (import { Panel } from './styled'). The imported module is read the same syntactic way as the current file: atasty()or configured options-factory result, aconstalias of one, an import fromimportSources, a default export, or a re-export (export { … } from,export * from) that leads to one. Specifiers resolve with or without an extension, including./styled.jsforstyled.tsand directoryindexfiles. Reading the module needs thetypescriptpackage. Without it, imported components are not recognized, as before. Namespace imports (<UI.Panel />) and path aliases are not followed. -
#92
7328196Thanks @tenphi! - AStylestype annotation is read before the variable's name, soexport const CARD_STYLES: Styles = { … }is now linted likecardStyles: Styles. Before, every SCREAMING_CASE constant was skipped, and the$namekeys it declared were missing fromvalid-custom-property's file set. An unannotated constant is still not matched on its name. A map of styles (Record<K, Styles>,{ [key: string]: Styles },{ root: Styles }) is no longer checked as a style object itself: its values are, so variant names are not reported as unknown properties.valid-sub-elementno longer reports a sub-element whose value is a binding (Prefix: ADD_STYLES): aconstis followed to its value, and any other binding, member or call is accepted as a possible style object. -
#92
7328196Thanks @tenphi! -valid-custom-propertyaccepts custom properties declared throughtokensin the same file:$namekeys of a literaltokens={{ … }}JSX prop or of thetokensoption oftasty()(or a configured options factory), and'--name'keys of a literal inlinestyle={{ … }}, which set the same property. Followingno-style-prop's advice to move'--progress'intotokens={{ $progress: … }}no longer leads to an unknown-property warning. The message now says to declare the property "in a styles object or 'tokens' prop in this file", since the check covers the whole file.