Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v8.0.0 release #39

Merged
merged 16 commits into from Sep 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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