All Projects → kristerkari → stylelint-z-index-value-constraint

kristerkari / stylelint-z-index-value-constraint

Licence: MIT license
Stylelint rule for setting minimum and maximum constraint value for z-index.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to stylelint-z-index-value-constraint

stylelint-scss
A collection of SCSS specific linting rules for Stylelint
Stars: ✭ 812 (+4411.11%)
Mutual labels:  stylelint, linter-plugin
website-template
静的Webサイト制作を少しモダンにするためのテンプレート
Stars: ✭ 62 (+244.44%)
Mutual labels:  stylelint
eslint-config-ns
ESLint config ready to be used in multiple projects. Based on Airbnb's code style with prettier, jest and react support.
Stars: ✭ 27 (+50%)
Mutual labels:  stylelint
html-sass-jumpstart
Minimal Sass/HTML Template Site - dart sass powered, includes stylelint and prettier, and autoprefix upon build. develop script includes hot-reload via browsersync.
Stars: ✭ 82 (+355.56%)
Mutual labels:  stylelint
vscode-linter
Extension for code linting, all in one package. New linters can be easily added through an extension framework.
Stars: ✭ 47 (+161.11%)
Mutual labels:  stylelint
stylelint-config
Sharable stylelint config used by GitHub's CSS
Stars: ✭ 194 (+977.78%)
Mutual labels:  stylelint
starter-kit
🏃 A simple and powerful Starter Kit made with Webpack, Gulp 4, Pug and SASS
Stars: ✭ 21 (+16.67%)
Mutual labels:  stylelint
flake8-mypy
A plugin for flake8 integrating Mypy.
Stars: ✭ 103 (+472.22%)
Mutual labels:  linter-plugin
static-webpack-boilerplate
🚀 Minimal & Modern Webpack Boilerplate for building static sites
Stars: ✭ 40 (+122.22%)
Mutual labels:  stylelint
eslint-config-stylelint
Stylelint org's shareable config for eslint
Stars: ✭ 45 (+150%)
Mutual labels:  stylelint
cra-template-quickstart-redux
Opinionated quickstart Create React App template with Redux, React Testing Library and custom eslint configuration
Stars: ✭ 66 (+266.67%)
Mutual labels:  stylelint
ultimate-hot-boilerplate
🚀 node-react universal app boilerplate with everything on hot reload, SSR, GraphQL, Flow included
Stars: ✭ 35 (+94.44%)
Mutual labels:  stylelint
nerv-webpack-boilerplate
A webpack boilerplate with Nervjs
Stars: ✭ 52 (+188.89%)
Mutual labels:  stylelint
Husky.Net
Git hooks made easy with Husky.Net internal task runner! 🐶 It brings the dev-dependency concept to the .NET world!
Stars: ✭ 394 (+2088.89%)
Mutual labels:  stylelint
EditorConfig-Action
🔎A GitHub Action to check, enforce & fix EditorConfig style violations
Stars: ✭ 40 (+122.22%)
Mutual labels:  stylelint
linter-ansible-linting
ansible-lint linter for atom
Stars: ✭ 19 (+5.56%)
Mutual labels:  linter-plugin
stencil-boilerplate
A Stencil app boilerplate including routing, Redux etc.
Stars: ✭ 51 (+183.33%)
Mutual labels:  stylelint
sonar-css-plugin
SonarQube CSS / SCSS / Less Analyzer
Stars: ✭ 46 (+155.56%)
Mutual labels:  stylelint
stylelint-config
App for generating stylelint config online
Stars: ✭ 100 (+455.56%)
Mutual labels:  stylelint
lints
Lint all your JavaScript, CSS, HTML, Markdown and Dockerfiles with a single command
Stars: ✭ 14 (-22.22%)
Mutual labels:  stylelint

stylelint-z-index-value-constraint

NPM version Build Status Downloads per month contributions welcome

Stylelint rule for setting minimum and maximum constraint value for z-index.

This is a fork of niksy/stylelint-number-z-index-constraint plugin.

Install

npm install stylelint-z-index-value-constraint --save-dev

or

yarn add stylelint-z-index-value-constraint --dev

Usage

Add this config to your .stylelintrc:

{
  "plugins": ["stylelint-z-index-value-constraint"],
  "rules": {
    "plugin/z-index-value-constraint": {
      "min": 1,
      "max": 10
    }
  }
}

Details

a {
  z-index: 10;
}
/**        ↑
 * This number */

From CSS Tricks article:

It's fairly common to see people number in the hundreds with z-index in web design too. The idea being that you could slip something in between later if need be, which you couldn't if you did 1, 2, 3, etc, because z-index doesn't support decimals.

This rule also handles negative values.

Options

{ min: 10 }

The following patterns are considered warnings:

a {
  z-index: 9;
}
input {
  z-index: 2;
}
a {
  z-index: -9;
}
input {
  z-index: -2;
}

The following patterns are not considered warnings:

a {
  z-index: 10;
}
input {
  z-index: 25;
}
a {
  z-index: -10;
}
input {
  z-index: -25;
}

{ max: 9999 }

The following patterns are considered warnings:

a {
  z-index: 10000;
}
input {
  z-index: 200000;
}
a {
  z-index: -10000;
}
input {
  z-index: -200000;
}

The following patterns are not considered warnings:

a {
  z-index: 9999;
}
input {
  z-index: 8000;
}
a {
  z-index: -9999;
}
input {
  z-index: -8000;
}

Optional options

ignoreValues: ["number"]

{ max: 10 }, { ignoreValues: [11, 20] }

The following patterns are considered warnings:

a {
  z-index: 12;
}
input {
  z-index: 19;
}

The following patterns are not considered warnings:

a {
  z-index: 11;
}
input {
  z-index: 20;
}

Dependencies

This plugin has only stylelint as a dependency.


License

MIT

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].