Skip to content

Commit

Permalink
Upgrade stylelint and improve the way we run it (#440)
Browse files Browse the repository at this point in the history
This turns off the ignore for SCSS module files and makes stylelint use `.gitignore`. This is the same way we ignore files for ESLint.
  • Loading branch information
danoc authored Aug 27, 2019
1 parent d3db5c1 commit 0ed46ca
Show file tree
Hide file tree
Showing 3 changed files with 204 additions and 202 deletions.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"test:prettier": "./scripts/test-prettier.sh",
"test:lint": "yarn test:lint:md && yarn test:lint:css && yarn test:lint:js",
"test:lint:md": "remark \"packages/*/CHANGELOG.md\" --frail --quiet",
"test:lint:css": "stylelint --ignore-pattern **/*.module.scss **/*.scss",
"test:lint:css": "stylelint \"**/*.scss\" \"**/*.css\" --ignore-path .gitignore",
"test:lint:js": "eslint . --ignore-path .gitignore --ext .jsx --ext .js"
},
"devDependencies": {
Expand Down Expand Up @@ -55,10 +55,10 @@
"react": "^16.8.6",
"react-dom": "^16.8.6",
"remark-cli": "^5.0.0",
"stylelint": "^9.10.1",
"stylelint-config-prettier": "^4.0.0",
"stylelint-config-recommended-scss": "^3.2.0",
"stylelint-scss": "^3.5.0"
"stylelint": "^10.1.0",
"stylelint-config-prettier": "^5.2.0",
"stylelint-config-recommended-scss": "^3.3.0",
"stylelint-scss": "^3.10.0"
},
"repository": {
"type": "git",
Expand Down
8 changes: 8 additions & 0 deletions stylelint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,13 @@ module.exports = {
// Turned off due to false positives:
// https://github.com/stylelint/stylelint/issues/2489
'no-descending-specificity': null,
// `:global` is used for CSS modules
// https://github.com/stylelint/stylelint/issues/2208#issuecomment-269245751
'selector-pseudo-class-no-unknown': [
true,
{
ignorePseudoClasses: ['global'],
},
],
},
};
Loading

0 comments on commit 0ed46ca

Please sign in to comment.