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

Support for Stylelint v14.4 #23

Merged
merged 2 commits into from
Feb 9, 2022
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
16 changes: 16 additions & 0 deletions .github/workflows/NodeCI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,19 @@ jobs:
run: npm i --legacy-peer-deps
- name: Test
run: npm test
test-old-vers:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14.x
- name: Downgrade Packages
run: |
npm install --save-exact stylelint@14.0.0 --legacy-peer-deps
npm install --save-exact stylelint-config-recommended@6.0.0 --legacy-peer-deps
npx rimraf node_modules
- name: Install Packages
run: npm i --legacy-peer-deps
- name: Test
run: npm test
13 changes: 13 additions & 0 deletions lib/vue-specific-rules.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
"use strict"

const semver = require("semver")
let stylelintVersion = "14.4.0"
try {
stylelintVersion = require("stylelint/package.json").version
} catch {
// ignore
}

module.exports = {
"selector-pseudo-class-no-unknown": [
true,
Expand All @@ -13,4 +21,9 @@ module.exports = {
ignorePseudoElements: ["v-deep", "v-global", "v-slotted"],
},
],
...(semver.gte(stylelintVersion, "14.4.0")
? {
"function-no-unknown": null,
}
: {}),
}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"preversion": "npm test && git add ."
},
"dependencies": {
"semver": "^7.3.5",
"stylelint-config-html": ">=1.0.0",
"stylelint-config-recommended": ">=6.0.0"
},
Expand All @@ -43,7 +44,8 @@
"eslint-plugin-vue": "^8.0.0",
"eslint-plugin-yml": "^0.13.0",
"mocha": "^9.1.3",
"prettier": "^2.4.1"
"prettier": "^2.4.1",
"stylelint": "^14.4.0"
},
"repository": {
"type": "git",
Expand Down