Skip to content

Releases: primer/stylelint-config

v9.2.3

29 Oct 20:01
bf6099f
Compare
Choose a tag to compare

🐛 Bug fixes

  • Fix no-undefined-vars to support values with CSS variable fallbacks

v9.2.2

29 Oct 19:59
0e07d72
Compare
Choose a tag to compare

🐛 Bug fixes

  • Update string.prototype.matchall to fix a transitive dependency issue

v9.2.1

02 Oct 17:12
4d7b154
Compare
Choose a tag to compare

🐛 Bug fixes

  • Fix slow runtime by caching variable definitions in primer/no-undefined-vars rule
  • Fix duplicate errors in primer/no-undefined-vars rule

v9.2.0

01 Oct 21:38
8446994
Compare
Choose a tag to compare

🚀 Enhancements

  • New primer/no-undefined-vars to prohibit usages of undefined CSS variables

v9.1.0

23 Sep 23:53
c2174ec
Compare
Choose a tag to compare

🚀 Enhancements

  • The primer/colors, primer/borders, and primer/box-shadow rules now allow CSS color variables with the correct functional names (e.g. var(--color-text-primary)). #62

v9.0.0 (October 29, 2019)

30 Oct 00:04
6e88bbf
Compare
Choose a tag to compare

💥 Breaking Change

  • primer/variables is no longer supported; please use the primer/colors, primer/borders, primer/box-shadow, primer/spacing, and primer/typography rules instead. #50

🚀 Enhancements

  • The new primer/colors rule enforces color variable usage in color, background-color, and fill 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 in font-family, line-height, and font-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: 'stylelint-config-primer',
      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 in primer/box-shadow to prevent multiple warnings for a single value like box-shadow: inset 0 1px $blue (before there would be 4 separate ones!).

🐛 Bug fixes

  • Use requirePrimerFile() when loading dist/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 in primer/box-shadow to match $btn-active-shadow and $form-control-shadow
  • Allow color: inherit in primer/colors
  • Allow $em-spacer-* in padding and margin properties
  • Allow (and auto-fix!) negative spacer variables in margin properties
  • Make primer/colors smarter re: background property shorthand values (allowing positions and image url(*) values)
  • Remove 100% from allowed values for border-radius, and suggest 50% instead
  • Prohibit negative spacer values in padding properties
  • Allow $h000-size for marketing

v8.2.1

02 Oct 23:49
0a63123
Compare
Choose a tag to compare

🐛 Bug fix

  • Add globby as a direct dependency. It was masked by npm's hoisting in the last release. ☹️

v8.2.0

02 Oct 23:30
871b0d8
Compare
Choose a tag to compare

🚀 Features

  • The new primer/no-unused-vars rule helps catch unused Sass variables in your project #46
  • The new primer/variables rule helps enforce the use of specific Primer SCSS variables in a variety of known CSS properties, and can fix common problems automatically! #28

📝 Documentation

🏠 Internal

  • Resolve a security vulnerability with npm audit fix

v8.1.0

20 Sep 06:21
a1d7adb
Compare
Choose a tag to compare

🚀 New features

  • The primer/no-override rule now has an ignoreSelectors option, which takes an array of strings and/or regular expressions or a function to ignore (pass) matched selectors.

🐛 Bug fixes

  • primer/no-override now really only counts class selectors as violations!

v8.0.0 (September 9, 2019)

09 Sep 18:48
d6b8c95
Compare
Choose a tag to compare

💥 Breaking changes

  • Remove stylelint-selector-no-utility and all references #41
  • Focus primer/no-overrides solely on class selectors, and improve error messages #37

🏠 Internal

  • Upgrade stylelint-scss to 3.10.0 (closes #34)
  • Migrate to Actions v2 #40
  • npm audit fix to resolve dependency security vulnerabilities