- #262
28a4086
Thanks @jonrohan! - Writing a primer/utilities plugin to look for code that duplicates utilities
- #232
27ddfc9
Thanks @jonrohan! - Creating a responsive-widths plugin to keep fixed widths smaller than the minimum viewport size
- #213
2a27f86
Thanks @jonrohan! - Fixing an issue where the new spacing plugin isn't traversing child sectors.
- #170
b56fcd1
Thanks @jonrohan! - Moving config from primer/css's stylelint.config.cjs file to this package.
- #170
b56fcd1
Thanks @jonrohan! - Adding config from the stylelint-scss recommended config.
- #161
48c4afc
Thanks @dependabot! - Bump @primer/primitives from 6.1.0 to 7.0.1
- #151
d7c8b2b
Thanks @jonrohan! - Adding string-quotes rule to config
- #146
214362c
Thanks @dependabot! - Bump @primer/css from 13.2.0 to 16.3.0
- #129
653d596
Thanks @jonrohan! - Renaming the package to use org scope. This is a breaking change, you'll need to uninstallstylelint-config-primer
and reinstall@primer/stylelint-config
.
e83f61c
#99 Thanks @jonrohan! - Create ano-deprecated-colors
rule that looks for deprecated css color variables from primer/primitives.
581f40a
#105 Thanks @jonrohan! - Adding reporting to the linter to know how many variables are replaced
aa76171
#90 Thanks @jonrohan! - Updating the no-undefined-variables lint for the new color-variables mixin.
-
23a1f15
#85 Thanks @koddsson! - Replace deprecated "blacklist" rules for "disallow list" rules.See https://stylelint.io/user-guide/rules/at-rule-blacklist and http://stylelint.io/user-guide/rules/declaration-property-value-disallowed-list/
a339c69
#81 Thanks @BinaryMuse! - Update globby to v11
d18cfbf
#79 Thanks @BinaryMuse! - Add additional verbose logging tono-undefined-vars
d18cfbf
#79 Thanks @BinaryMuse! - Fix handling of edge-cases inno-undefined-vars
bb07673
#76 Thanks @BinaryMuse! - Set the default verbose option forno-scale-colors
to false
df11e2d
#74 Thanks @BinaryMuse! - Add primer/no-scale-colors to the list of exported plugins
- Fix slow runtime by caching variable definitions in
primer/no-undefined-vars
rule - Fix duplicate errors in
primer/no-undefined-vars
rule
- New
primer/no-undefined-vars
to prohibit usages of undefined CSS variables
- The
primer/colors
,primer/borders
, andprimer/box-shadow
rules now allow CSS color variables with the correct functional names (e.g.var(--color-text-primary)
). #62
primer/variables
is no longer supported; please use theprimer/colors
,primer/borders
,primer/box-shadow
,primer/spacing
, andprimer/typography
rules instead. #50
- The new
primer/colors
rule enforces color variable usage incolor
,background-color
, andfill
properties - The new
primer/borders
rule enforces border variable usage in border CSS props - The new
primer/box-shadow
rule enforces$box-shadow*
variables - The new
primer/spacing
rule enforces$spacer-*
variables in margin and padding props - The new
primer/typography
rule enforces typography variable use infont-family
,line-height
, andfont-weight
props - Variable replacements for autofixing are automatically detected in variable data from Primer CSS (see: primer/css#949) #52
- It is now possible to define variable rules using functions that take the variables, as in:
module.exports = createVariableRule('primer/whatever', ({variables}) => { /* do something with variables here */ })
- It's also now possible to provide rule overrides in local stylelint configs as functions:
module.exports = { extends: '@primer/stylelint-config', rules: { 'primer/colors': [true, { rules: ({variables, rules}) => { /* do something with variables and/or rules here */ return rules }] } })
- This release adds support for an optional
singular: true
flag to rule configs, which skips the parsing of individual values in the matched properties. We use this inprimer/box-shadow
to prevent multiple warnings for a single value likebox-shadow: inset 0 1px $blue
(before there would be 4 separate ones!).
- Use
requirePrimerFile()
when loadingdist/variables.json
so that we can access the right file when running within the@primer/css
repo. - Walk only declarations (
prop: value
) in rules (blocks with selectors, not@rules
), and skip linting for declarations nested in@each
,@for
,@function
, and@mixin
blocks, since those can define their own variables and we can't reliably assert their values. - Allow
$*-shadow
variable patterns inprimer/box-shadow
to match$btn-active-shadow
and$form-control-shadow
- Allow
color: inherit
inprimer/colors
- Allow
$em-spacer-*
inpadding
andmargin
properties - Allow (and auto-fix!) negative spacer variables in
margin
properties - Make
primer/colors
smarter re:background
property shorthand values (allowing positions and imageurl(*)
values) - Remove
100%
from allowed values forborder-radius
, and suggest50%
instead - Prohibit negative spacer values in
padding
properties - Allow
$h000-size
for marketing π¬
π₯ The following updates are breaking changes, since code that disables the deprecated rule will now produce linting errors. Please update your stylelint-disable
statements accordingly.
- Replaced
selector-no-id: true
withselector-max-id: 0
- Replaced
selector-no-type: true
withselector-max-type: 0
The rest of the changes should not introduce new linting errors:
- Updated: moved browserslist spec to
package.json
- Updated: using the
no-unsupported-browser-features
plugin instead of the deprecatedno-unsupported-browser-features
rule - Removed:
media-feature-no-missing-punctuation
- Updated: replaced
rule-nested-empty-line-before
andrule-non-nested-empty-line-before
withrule-empty-line-before
- Updated: Development dependencies are any version
*
- Removed:
selector-class-pattern
from config. primer#11
- Added:
length-zero-no-unit
to disallow zero values with units eg0px
- Removed: We don't need
scss/at-extend-no-missing-placeholder
anymore taken care of byat-rule-blacklist
- Added: Adding
selector-no-type
to the rules
- Creating a sharable config object