Skip to content

Commit

Permalink
Upgrading to stylelint 15.10.2 (#356)
Browse files Browse the repository at this point in the history
* Upgrading to stylint 15.10.2

Co-authored-by: Katie Langerman <langermank@users.noreply.github.com>

* Change to npm

* Fixing tests

* Fix lint

* Updating rules to match dotcom

* Create lazy-bikes-roll.md

---------

Co-authored-by: Katie Langerman <langermank@users.noreply.github.com>
  • Loading branch information
jonrohan and langermank authored Aug 17, 2023
1 parent cdb7ca9 commit fdf5660
Show file tree
Hide file tree
Showing 12 changed files with 10,640 additions and 5,442 deletions.
5 changes: 5 additions & 0 deletions .changeset/lazy-bikes-roll.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/stylelint-config": minor
---

Upgrading to stylelint 15.10.2
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 16
- run: yarn
- run: yarn test
- run: npm ci
- run: npm run test
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- run: yarn
- run: yarn lint
- run: npm ci
- run: npm run lint
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ jobs:
node-version: 16

- name: Install dependencies
run: yarn
run: npm ci

- name: Create release pull request or publish to npm
id: changesets
uses: changesets/action@master
with:
title: Release Tracking
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: yarn release
publish: npm run release
env:
GITHUB_TOKEN: ${{ secrets.GPR_AUTH_TOKEN_SHARED }}
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN_SHARED }}
6 changes: 3 additions & 3 deletions .github/workflows/release_canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
node-version: 16

- name: Install dependencies
run: yarn
run: npm ci

- name: Create .npmrc
run: |
Expand All @@ -40,8 +40,8 @@ jobs:
echo "$( jq '.version = "0.0.0"' package.json )" > package.json
echo -e "---\n'@primer/stylelint-config': patch\n---\n\nFake entry to force publishing" > .changeset/force-snapshot-release.md
rm -f .changeset/pre.json
yarn changeset version --snapshot
yarn changeset publish --tag canary
npx changeset version --snapshot
npx changeset publish --tag canary
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release_candidate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
node-version: 16

- name: Install dependencies
run: yarn
run: npm ci

- name: Create .npmrc
run: |
Expand All @@ -37,7 +37,7 @@ jobs:
run: |
version=$(jq -r .version package.json)
echo "$( jq ".version = \"$(echo $version)-rc.$(git rev-parse --short HEAD)\"" package.json )" > package.json
yarn publish --tag next
npm publish --tag next
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*.log
coverage/
node_modules/
package-lock.json
yarn.lock
1 change: 0 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
git-tag-version=false
package-lock=false
3 changes: 2 additions & 1 deletion __tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@ describe('stylelint-config', () => {
.foo {
width: 10px;
top: .2em;
max-width: initial;
}
`).then(data => {
expect(data).toHaveErrored()
expect(data).toHaveWarningsLength(2)
expect(data).toHaveWarnings([
'Expected "top" to come before "width" (order/properties-order)',
'Expected a leading zero (number-leading-zero)',
'Unexpected value "initial" for property "max-width" (declaration-property-value-disallowed-list)',
])
})
})
Expand Down
10 changes: 6 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ module.exports = {
'declaration-block-no-duplicate-properties': [true, {ignore: ['consecutive-duplicates']}],
'declaration-block-no-redundant-longhand-properties': null,
'declaration-block-no-shorthand-property-overrides': true,
'declaration-block-semicolon-newline-after': 'always',
'declaration-property-value-disallowed-list': {
'/^transition/': ['/all/'],
'/^background/': ['http:', 'https:'],
Expand All @@ -47,13 +46,11 @@ module.exports = {
'function-linear-gradient-no-nonstandard-direction': true,
'function-no-unknown': null,
'keyframes-name-pattern': null,
'max-line-length': null,
'max-nesting-depth': 3,
'media-feature-name-no-unknown': null,
'media-feature-name-no-vendor-prefix': null,
'no-descending-specificity': null,
'no-duplicate-selectors': true,
'no-extra-semicolons': true,
'no-invalid-position-at-import-rule': [true, {ignoreAtRules: ['use']}],
'number-max-precision': null,
'order/properties-order': propertyOrder,
Expand Down Expand Up @@ -94,8 +91,13 @@ module.exports = {
'selector-no-qualifying-type': true,
'selector-pseudo-element-no-unknown': true,
'string-no-newline': true,
'string-quotes': 'single',
'unit-no-unknown': true,
'value-keyword-case': null,
'selector-not-notation': null,
'import-notation': ['string'],
'annotation-no-unknown': null,
'keyframe-selector-notation': ['percentage-unless-within-keyword-only-block'],
'media-query-no-invalid': null,
'media-feature-range-notation': ['prefix'],
},
}
Loading

0 comments on commit fdf5660

Please sign in to comment.