Socket
Socket
Sign inDemoInstall

eslint-plugin-stylable

Package Overview
Dependencies
Maintainers
4
Versions
139
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-stylable

eslint plugin for Stylable usages


Version published
Weekly downloads
59
decreased by-65.5%
Maintainers
4
Weekly downloads
 
Created
Source

Stylable eslint plugin

Adds Stylable lint rules that warn about usages of unknown stylesheet locals (classes, css vars, Stylable vars and keyframes).

Example

Trying to access an unknown class from the comp.st.css stylesheet:

/* comp.st.css */
.root {}
.part {}
import { classes } from './comp.st.css';

// ...

const render = (<div className={classes.root} >
  <div className={classes.missing} /> // unknown local class "missing" used from stylesheet ./comp.st.css
</div>)

Install

npm install eslint-plugin-stylable --save-dev or yarn add eslint-plugin-stylable --dev

Config

.eslintrc config

  "extends": ["plugin:stylable/recommended"]

Options

OptionTypeDefaultDescription
resolveOptionsobject{}Stylable resolver options
exposeDiagnosticsReportsbooleanfalseexpose Stylable transpilation diagnostics on the import statement

Known issue

ESLint is not intended for multi-file operations, such as validating your TS when an .st.css files changes. This means that the plugin might lose track of stylesheet changes and work with stale data.

This behavior will show out-of-date errors or will miss new errors in your TS files. Manually triggering a change in the stylesheet file will sync ESlint and update the diagnostics.

License

Copyright (c) 2021 Wix.com Ltd. All Rights Reserved. Use of this source code is governed by a MIT license.

Keywords

FAQs

Package last updated on 30 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc