Skip to content

A custom stylelint rule to enforce a convention of 'border: 0' or 'border: none'

License

Notifications You must be signed in to change notification settings

timothyneiljohnson/stylelint-value-border-zero

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stylelint-value-border-zero

Build Status

A stylelint custom rule to set a convention of border: 0 or border: none.

This rule will cause stylelint to warn you whenever the preferred convention is not used.

Installation

npm install stylelint-value-border-zero

This plugin is compatible with v5.0.1+.

Details

Both border: none and border: 0 are technically valid, however, many developers feel strongly about setting a convention one way or the other, and following it. That is what this plugin offers.

With the convention option set to '0':

a { /* OK */
  border: 0
}

a { /* Not OK */
  border: none
}

With the convention option set to 'none':

a { /* OK */
  border: none
}

a { /* Not OK */
  border: 0
}

This rule applies to the following border properties.

border
border-top
border-right
border-bottom
border-left

Usage

Add "stylelint-value-border-zero" to your stylelint config plugins array, then add value-border-zero to your rules, setting the convention option to "0" or "none".

As follows:

{
  "plugins": [
    "stylelint-value-border-zero"
  ],
  "rules": {
    "value-border-zero": {
      "convention": "0" // Or "none"
    }
  }
};

About

A custom stylelint rule to enforce a convention of 'border: 0' or 'border: none'

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published