Skip to content

Commit

Permalink
Merge branch 'main' into primer_border_update
Browse files Browse the repository at this point in the history
  • Loading branch information
jonrohan committed May 14, 2024
2 parents 02bd801 + 86cf24f commit a98cb25
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 660 deletions.
5 changes: 5 additions & 0 deletions .changeset/tasty-cooks-do.md
@@ -0,0 +1,5 @@
---
"@primer/stylelint-config": major
---

Deleting primer/utilities plugin
9 changes: 7 additions & 2 deletions .github/workflows/release_canary.yml
@@ -1,11 +1,16 @@
name: Release
on: [workflow_dispatch]
on:
push:
branches-ignore:
- 'main'
- 'changeset-release/**'
- 'dependabot/**'

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
19 changes: 19 additions & 0 deletions .github/workflows/release_tracking.yml
@@ -0,0 +1,19 @@
name: Release Event Tracking
# Measure a datadog event every time a release occurs

on:
pull_request:
types:
- closed
- opened
- reopened

release:
types: [published]

jobs:
release-tracking:
name: Release Tracking
uses: primer/.github/.github/workflows/release_tracking.yml@create_release_tracking_workflow
secrets:
datadog_api_key: ${{ secrets.DATADOG_API_KEY }}
1 change: 0 additions & 1 deletion README.md
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
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
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

0 comments on commit a98cb25

Please sign in to comment.