Skip to content

Commit

Permalink
ci: patch stylelint-config-prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
JounQin committed Apr 1, 2023
1 parent 20b1b9e commit 16de2e5
Show file tree
Hide file tree
Showing 6 changed files with 185 additions and 926 deletions.
1 change: 1 addition & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ LICENSE
*.json5
*.lock
*.log
*.patch
# TODE: make it work
*.pug
*.sh
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"lint:es": "eslint . --cache -f friendly",
"lint:style": "stylelint . --cache",
"lint:tsc": "tsc --noEmit",
"prepare": "simple-git-hooks",
"prepare": "patch-package && simple-git-hooks && yarn-deduplicate -s fewer || exit 0",
"release": "changeset publish",
"test": "vitest run --coverage",
"typecov": "type-coverage"
Expand All @@ -35,6 +35,7 @@
"@types/react": "^18.0.31",
"@types/unist": "^2.0.6",
"@vitest/coverage-istanbul": "^0.29.8",
"patch-package": "^6.5.1",
"postcss": "^8.4.21",
"react": "^18.2.0",
"rxjs": "^7.8.0",
Expand All @@ -44,7 +45,8 @@
"typescript": "^5.0.3",
"vitest": "^0.29.8",
"vue": "^3.2.47",
"vue-tsc": "^1.2.0"
"vue-tsc": "^1.2.0",
"yarn-deduplicate": "^6.0.1"
},
"resolutions": {
"prettier": "^2.7.1"
Expand Down
2 changes: 2 additions & 0 deletions packages/stylelint-config/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module.exports = {
'stylelint-no-unsupported-browser-features',
],
rules: {
'at-rule-empty-line-before': null,
'plugin/no-low-performance-animation-properties': true,
'plugin/no-unsupported-browser-features': [
true,
Expand All @@ -21,6 +22,7 @@ module.exports = {
severity: 'warning',
},
],
'selector-attribute-quotes': null,
'selector-class-pattern': [
'^[a-z]([\\da-z-]+)?(__([\\da-z]+-?)+)?(--([\\da-z]+-?)+){0,2}$',
{
Expand Down
6 changes: 0 additions & 6 deletions packages/stylelint-config/scss/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ module.exports = {
ignoreAnnotations: ['default'],
},
],
'at-rule-empty-line-before': [
'always',
{
ignoreAtRules: ['else'],
},
],
'at-rule-no-unknown': null,
'function-no-unknown': null,
'scss/at-each-key-value-single-line': true,
Expand Down
13 changes: 13 additions & 0 deletions patches/stylelint-config-prettier+9.0.5.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/node_modules/stylelint-config-prettier/src/checker.js b/node_modules/stylelint-config-prettier/src/checker.js
index 83714bd..3619e19 100644
--- a/node_modules/stylelint-config-prettier/src/checker.js
+++ b/node_modules/stylelint-config-prettier/src/checker.js
@@ -30,7 +30,7 @@ async function getConfig(linter, resolvedPath) {

async function check(path) {
const resolvedPath = resolve(process.cwd(), path || '');
- const linter = stylelint.createLinter();
+ const linter = (stylelint.createLinter || stylelint._createLinter)();
const config = await getConfig(linter, resolvedPath);

const prettierRules = stylelintConfigPrettier.rules;
Loading

0 comments on commit 16de2e5

Please sign in to comment.