Skip to content

Commit

Permalink
Merge pull request #39 from primer/release-8.0.0
Browse files Browse the repository at this point in the history
chore: v8.0.0
  • Loading branch information
shawnbot committed Sep 9, 2019
2 parents 624dd86 + e59866d commit d6b8c95
Show file tree
Hide file tree
Showing 11 changed files with 253 additions and 1,378 deletions.
31 changes: 0 additions & 31 deletions .github/main.workflow

This file was deleted.

20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
@@ -0,0 +1,20 @@
name: CI
on: [push]
jobs:
all:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@master
with:
version: 11
- name: install
run: npm install
- name: lint
run: npm run lint
- name: test
run: npm test
- uses: primer/publish@v1.1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
2 changes: 0 additions & 2 deletions .npmrc
@@ -1,3 +1 @@
save=true
save-exact=true
git-tag-version=false
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -26,7 +26,7 @@ Within your [stylelint config object](http://stylelint.io/user-guide/configurati

* [stylelint-scss](https://github.com/kristerkari/stylelint-scss): A collection of SCSS specific linting rules for stylelint
* [scss/selector-no-redundant-nesting-selector](https://github.com/kristerkari/stylelint-scss/blob/master/src/rules/selector-no-redundant-nesting-selector/README.md): Disallow redundant nesting selectors (`&`).
* [stylelint-selector-no-utility](https://github.com/primer/stylelint-selector-no-utility): Stylelint rule that doesn't allow the styling of utility classes in CSS
* [primer/no-override](plugins/no-override.js): Prohibits custom styles that target Primer CSS selectors.

### Configured lints

Expand Down
23 changes: 1 addition & 22 deletions __tests__/index.js
@@ -1,4 +1,4 @@
const {lint, extendDefaultConfig} = require('./utils')
const {lint} = require('./utils')

const SAFE_SCSS_EXAMPLE = `
.Component { color: $gray-500; }
Expand Down Expand Up @@ -47,25 +47,4 @@ describe('stylelint-config-primer', () => {
expect(data).toHaveDeprecationsLength(0)
})
})

it('warns about the planned deprecation of primer/selector-no-utility', () => {
return lint(
SAFE_SCSS_EXAMPLE,
extendDefaultConfig({
rules: {
'primer/selector-no-utility': true
}
})
).then(data => {
expect(data).not.toHaveErrored()
expect(data).not.toHaveResultsLength(0)
expect(data).toHaveDeprecationsLength(1)
expect(data.results[0].deprecations).toEqual([
{
text: `'primer/selector-no-utility' has been deprecated and will be removed in stylelint-config-primer@7.0.0. Please update your rules to use 'primer/no-override'.`,
reference: 'https://github.com/primer/stylelint-config-primer#deprecations'
}
])
})
})
})
8 changes: 5 additions & 3 deletions __tests__/no-override.js
Expand Up @@ -5,7 +5,7 @@ describe('primer/no-override', () => {
return lint('.text-gray { color: #111; }').then(data => {
expect(data).toHaveErrored()
expect(data).toHaveWarningsLength(1)
expect(data).toHaveWarnings([`The selector ".text-gray" should not be overridden. (primer/no-override)`])
expect(data).toHaveWarnings([`".text-gray" should not be overridden (found in utilities). (primer/no-override)`])
})
})

Expand All @@ -14,7 +14,7 @@ describe('primer/no-override', () => {
return lint(`${selector} { color: #f00; }`).then(data => {
expect(data).toHaveErrored()
expect(data).toHaveWarningsLength(1)
expect(data).toHaveWarnings([`The selector "${selector}" should not be overridden. (primer/no-override)`])
expect(data).toHaveWarnings([`"${selector}" should not be overridden (found in utilities). (primer/no-override)`])
})
})

Expand All @@ -23,7 +23,9 @@ describe('primer/no-override', () => {
return lint(`.foo ${selector}:focus { color: #f00; }`).then(data => {
expect(data).toHaveErrored()
expect(data).toHaveWarningsLength(1)
expect(data).toHaveWarnings([`The selector "${selector}" should not be overridden. (primer/no-override)`])
expect(data).toHaveWarnings([
`"${selector}" should not be overridden in ".foo ${selector}:focus" (found in utilities). (primer/no-override)`
])
})
})

Expand Down
8 changes: 1 addition & 7 deletions index.js
Expand Up @@ -2,13 +2,7 @@ const browsers = require('./browsers')
const propertyOrder = require('./property-order')

module.exports = {
plugins: [
'stylelint-no-unsupported-browser-features',
'stylelint-order',
'stylelint-scss',
'./plugins/no-override',
'./plugins/selector-no-utility'
],
plugins: ['stylelint-no-unsupported-browser-features', 'stylelint-order', 'stylelint-scss', './plugins/no-override'],
rules: {
'at-rule-blacklist': ['extend'],
'at-rule-name-case': 'lower',
Expand Down

0 comments on commit d6b8c95

Please sign in to comment.