All Projects → Slamdunk → Stylelint No Browser Hacks

Slamdunk / Stylelint No Browser Hacks

Licence: mit
Stylelint plugin for stylehacks linting

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to Stylelint No Browser Hacks

jest-runner-stylelint
Stylelint runner for Jest
Stars: ✭ 18 (+50%)
Mutual labels:  stylelint
React 2048 Game
🎮 A fancy 2048 game build with react, redux best practices.
Stars: ✭ 401 (+3241.67%)
Mutual labels:  stylelint
Stylelint Scss
A collection of SCSS specific linting rules for stylelint
Stars: ✭ 655 (+5358.33%)
Mutual labels:  stylelint
Fabric
💪一些保证代码质量的配置
Stars: ✭ 258 (+2050%)
Mutual labels:  stylelint
Stylelint Config Sass Guidelines
⚙ A stylelint config inspired by https://sass-guidelin.es/
Stars: ✭ 349 (+2808.33%)
Mutual labels:  stylelint
Magento2 Frontools
Set of front-end tools for Magento 2 based on Gulp.js
Stars: ✭ 416 (+3366.67%)
Mutual labels:  stylelint
starbase
⭐ Production-ready website boilerplate made with webpack 5, modern JS (via Babel 7) & Sass
Stars: ✭ 70 (+483.33%)
Mutual labels:  stylelint
Stylelint.io
The source of the stylelint website
Stars: ✭ 26 (+116.67%)
Mutual labels:  stylelint
Stylelint A11y
Plugin for stylelint with a11y rules
Stars: ✭ 384 (+3100%)
Mutual labels:  stylelint
Wemake Vue Template
Bleeding edge vue template focused on code quality and developer happiness.
Stars: ✭ 645 (+5275%)
Mutual labels:  stylelint
Vscode Stylelint
A Visual Studio Code extension to lint CSS/SCSS/Less with stylelint
Stars: ✭ 260 (+2066.67%)
Mutual labels:  stylelint
Stylelint Config Rational Order
Stylelint config that sorts related property declarations by grouping together in the rational order 🚦
Stars: ✭ 313 (+2508.33%)
Mutual labels:  stylelint
Stylelint Order
A plugin pack of order related linting rules for stylelint.
Stars: ✭ 607 (+4958.33%)
Mutual labels:  stylelint
Stylelint Config Recommended
The recommended shareable config for stylelint
Stars: ✭ 255 (+2025%)
Mutual labels:  stylelint
Stylefmt Loader
Webpack-loader. Fixes stylelint issues automatically while bundling with Webpack.
Stars: ✭ 24 (+100%)
Mutual labels:  stylelint
elint
A easy way to lint your code
Stars: ✭ 38 (+216.67%)
Mutual labels:  stylelint
Stylelint Webpack Plugin
A Stylelint plugin for webpack
Stars: ✭ 411 (+3325%)
Mutual labels:  stylelint
React Mobx React Router Boilerplate
A simple boilerplate based on create-react-app and add mobx, react-router, linter, prettier and so on. 一个简单的 react 脚手架依赖于 create-react-app 新增了 mobx react-router,linter,prettier 等。
Stars: ✭ 12 (+0%)
Mutual labels:  stylelint
Jest Styled Components Stylelint
Run stylelint on your styled-components styles at runtime.
Stars: ✭ 25 (+108.33%)
Mutual labels:  stylelint
Stylelint Processor Styled Components
Lint your styled components with stylelint!
Stars: ✭ 639 (+5225%)
Mutual labels:  stylelint

stylelint-no-browser-hacks

Build Status Latest version Dependency Status Downloads

A stylelint plugin that disallow browser hacks that are irrelevant to the browsers you are targeting, using stylehacks.

Original rule: stylelint/no-browser-hacks.

Disallow browser hacks that are irrelevant to the browsers you are targeting.

h1 { _color: white; }
/**  ↑
 * Hacks like this */

If you are uncertain what "browser hacks" are, "An Introduction to Browser-Specific Hacks" explains it well.

This rule uses stylehacks to detect the hacks. Then, in the spirit of stylelint, it tells you that you've done something wrong. If instead you would like to automatically remove browser hacks, use stylehacks directly.

stylehacks is only compatible with standard CSS syntax, and does not support nested properties nor custom property sets.

Bugs and feature requests should be reported on the stylehacks issue tracker.

Installation

npm install stylelint-no-browser-hacks

Usage

Add stylelint-no-browser-hacks to your stylelint config plugins array, then add rules you need to the rules list. Note that the rule is namespaced with plugin/.

Like so:

// .stylelintrc
{
	"plugins": [
		"/path/to/stylelint-no-browser-hacks/lib"
	],
	"rules": {
		// ...
		"plugin/no-browser-hacks": [true, {
            browsers: [
                "last 2 versions",
                "ie >=7"
            ]
        }],
		// ...
	}
}

Options

true

Defaults to the browserslist default, which targets modern browsers.

The following patterns are considered warnings:

a { color/*\**/: pink\9; }

As this hack targets IE7-8.

Optional secondary options

browsers: "browserslist string"

A string interpreted by browserslist that designates precisely which browsers you wish to support. Something like "> 1%, last 2 versions, ie >= 8". For details about the syntax (which is the same as when using Autoprefixer, by the way), please read the browserslist documentation.

If you set browsers: [ "last 2 versions", "ie >=7" ] the hack above is allowed.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].