Skip to content

Commit

Permalink
Deleting primer/utilities plugin (#415)
Browse files Browse the repository at this point in the history
* Deleting primer/utilities plugin

* Create tasty-cooks-do.md

* Update release_canary.yml

* Update release_canary.yml
  • Loading branch information
jonrohan authored May 13, 2024
1 parent 41d8848 commit 86cf24f
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 659 deletions.
5 changes: 5 additions & 0 deletions .changeset/tasty-cooks-do.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/stylelint-config": major
---

Deleting primer/utilities plugin
2 changes: 1 addition & 1 deletion .github/workflows/release_canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
release-canary:
name: npm
if: ${{ github.repository == 'primer/stylelint-config' }}
uses: primer/.github/.github/workflows/release_canary.yml@v2.0.0
uses: primer/.github/.github/workflows/release_canary.yml@v2.0.1
with:
install: npm i
secrets:
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ Primer Stylelint Config extends the [stylelint-config-standard](https://github.c
- [primer/borders](./plugins/#primerborders): Enforces the use of certain variables for border properties.
- [primer/box-shadow](./plugins/#primerbox-shadow): Enforces the use of certain variables for `box-shadow`.
- [primer/responsive-widths](./plugins/#primerresponsive-widths): Errors on `width` and `min-width` that is larger than the minimum browser size supported. `320px`
- [primer/utilities](./plugins/#primerutilities): Errors when someone writes custom CSS for a declaration that has an existing primer/css/utility.

## License

Expand Down
48 changes: 0 additions & 48 deletions __tests__/utilities.js

This file was deleted.

5 changes: 0 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import colors from './plugins/colors.js'
import responsiveWidths from './plugins/responsive-widths.js'
import spacing from './plugins/spacing.js'
import typography from './plugins/typography.js'
import utilities from './plugins/utilities.js'
import noDisplayColors from './plugins/no-display-colors.js'

import {createRequire} from 'node:module'
Expand All @@ -29,7 +28,6 @@ export default {
responsiveWidths,
spacing,
typography,
utilities,
noDisplayColors,
],
rules: {
Expand Down Expand Up @@ -97,7 +95,6 @@ export default {
'primer/responsive-widths': true,
'primer/spacing': true,
'primer/typography': true,
'primer/utilities': null,
'primer/no-display-colors': true,
'property-no-unknown': [
true,
Expand Down Expand Up @@ -152,7 +149,6 @@ export default {
'primer/borders': null,
'primer/typography': null,
'primer/box-shadow': null,
'primer/utilities': null,
},
},
{
Expand Down Expand Up @@ -207,7 +203,6 @@ export default {
'primer/borders': null,
'primer/typography': null,
'primer/box-shadow': null,
'primer/utilities': null,
},
},
],
Expand Down
26 changes: 0 additions & 26 deletions plugins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ This directory contains all of our custom stylelint plugins, each of which provi
- [`primer/borders`](#primerborders)
- [`primer/box-shadow`](#primerbox-shadow)
- [`primer/responsive-widths`](#primerresponsive-widths)
- [`primer/utilities`](#primerutilities)
- [Variable rules](#variable-rules)
- [Variable rule options](#variable-rule-options)

Expand Down Expand Up @@ -84,31 +83,6 @@ This [variable rule](#variable-rules) enforces the use of `$box-shadow*` variabl

This plugin checks for `width` and `min-width` declarations that use a value less than the minimum browser size. `320px`

## `primer/utilities`

Checks for selectors with single declarations that can be replaced with [primer/css utilities](https://primer.style/css/utilities/).

```scss
.foo {
color: var(--color-fg-default);
}
/** ↑
* FAIL: --color-fg-default can be replaced with .color-fg-default */

.foo {
color: #custom;
}
/** ↑
* OK: Color value doesn't match a utility. */

.foo {
color: var(--color-fg-default);
padding: 0;
}
/** ↑
* OK: Has more than one declaration, not considered */
```

## Variable rules

Variable rules are created using a general-purpose helper that can validate constraints for matching CSS properties and values. In general, the Primer CSS variable rules enforce two basic principles for custom CSS:
Expand Down
Loading

0 comments on commit 86cf24f

Please sign in to comment.