Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
eslint-plugin-stylable
Advanced tools
Adds Stylable lint rules that warn about usages of unknown stylesheet locals (classes, css vars, Stylable vars and keyframes).
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>)
npm install eslint-plugin-stylable --save-dev
or
yarn add eslint-plugin-stylable --dev
.eslintrc
config
"extends": ["plugin:stylable/recommended"]
Option | Type | Default | Description |
---|---|---|---|
resolveOptions | object | {} | Stylable resolver options |
exposeDiagnosticsReports | boolean | false | expose Stylable transpilation diagnostics on the import statement |
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.
Copyright (c) 2021 Wix.com Ltd. All Rights Reserved. Use of this source code is governed by a MIT license.
FAQs
eslint plugin for Stylable usages
The npm package eslint-plugin-stylable receives a total of 57 weekly downloads. As such, eslint-plugin-stylable popularity was classified as not popular.
We found that eslint-plugin-stylable demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
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.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.