Disallow property values that are ignored due to another property value in the same rule.
Installations
npm install stylelint-declaration-block-no-ignored-properties
Developer
kristerkari
Developer Guide
Module System
CommonJS
Min. Node Version
>=6
Typescript Support
No
Node Version
20.10.0
NPM Version
10.2.3
Statistics
105 Stars
200 Commits
8 Forks
5 Watching
35 Branches
4 Contributors
Updated on 28 Nov 2024
Bundle Size
3.80 kB
Minified
1.22 kB
Minified + Gzipped
Languages
JavaScript (100%)
Total Downloads
Cumulative downloads
Total Downloads
20,046,774
Last day
-8.6%
21,861
Compared to previous day
Last week
7.3%
124,609
Compared to previous week
Last month
2%
485,825
Compared to previous month
Last year
-0.2%
5,063,206
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Peer Dependencies
1
stylelint-declaration-block-no-ignored-properties
Original rule: stylelint/declaration-block-no-ignored-properties.
Disallow property values that are ignored due to another property value in the same rule.
1a { display: inline; width: 100px; } 2/** ↑ 3 * This property */
Certain property value pairs rule out other property value pairs, causing them to be ignored by the browser. For example, when an element has display: inline, any further declarations about width, height and margin-top properties will be ignored. Sometimes this is confusing: maybe you forgot that your margin-top will have no effect because the element has display: inline, so you spend a while struggling to figure out what you've done wrong. This rule protects against that confusion by ensuring that within a single rule you don't use property values that are ruled out by other property values in that same rule.
The rule complains when it finds:
display: inline
used withwidth
,height
,margin
,margin-top
,margin-bottom
,overflow
(and all variants).display: list-item
used withvertical-align
.display: block
used withvertical-align
.display: flex
used withvertical-align
.display: table
used withvertical-align
.display: table-*
(excepttable-caption
) used withmargin
.display: table-*
(excepttable-cell
) used withpadding
.display: table-*
(excepttable-cell
) used withvertical-align
.display: table-(row|row-group)
used withwidth
,min-width
ormax-width
.display: table-(column|column-group)
used withheight
,min-height
ormax-height
.float: left
andfloat: right
used withvertical-align
.position: static
used withtop
,right
,bottom
,left
orz-index
.position: absolute
used withfloat
,clear
orvertical-align
.position: fixed
used withfloat
,clear
orvertical-align
.list-style-type: none
used withlist-style-image
.overflow: visible
used withresize
.
Installation
npm install stylelint-declaration-block-no-ignored-properties --save-dev
Usage
1// .stylelintrc 2{ 3 "plugins": [ 4 "stylelint-declaration-block-no-ignored-properties" 5 ], 6 "rules": { 7 "plugin/declaration-block-no-ignored-properties": true, 8 } 9}
Options
true
The following patterns are considered violations:
1a { display: inline; width: 100px; }
display: inline
causes width
to be ignored.
1a { display: inline; height: 100px; }
display: inline
causes height
to be ignored.
1a { display: inline; margin: 10px; }
display: inline
causes margin
to be ignored.
1a { display: block; vertical-align: baseline; }
display: block
causes vertical-align
to be ignored.
1a { display: flex; vertical-align: baseline; }
display: flex
causes vertical-align
to be ignored.
1a { position: absolute; vertical-align: baseline; }
position: absolute
causes vertical-align
to be ignored.
1a { float: left; vertical-align: baseline; }
float: left
causes vertical-align
to be ignored.
The following patterns are not considered violations:
1a { display: inline; margin-left: 10px; }
1a { display: inline; margin-right: 10px; }
1a { display: inline; padding: 10px; }
1a { display: inline-block; width: 100px; }
Although display: inline
causes width
to be ignored, inline-block
works with width
.
1a { display: table-cell; vertical-align: baseline; }
Although display: block
causes vertical-align
to be ignored, table-cell
works with vertical-align
.
1a { position: relative; vertical-align: baseline; }
Although position: absolute
causes vertical-align
to be ignored, relative
works with vertical-align
.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
1 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
Reason
4 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 3
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/kristerkari/stylelint-declaration-block-no-ignored-properties/test.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/kristerkari/stylelint-declaration-block-no-ignored-properties/test.yml/master?enable=pin
- Info: 0 out of 2 GitHub-owned GitHubAction dependencies pinned
- Info: 1 out of 1 npmCommand dependencies pinned
Reason
Found 0/3 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/test.yml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 28 are checked with a SAST tool
Score
3.8
/10
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More