Open etylsarin opened 4 years ago
A temporary workaround until prettier-stylelint is fixed:
diff --git a/node_modules/prettier-stylelint/src/index.js b/node_modules/prettier-stylelint/src/index.js
index 124c00d..a6f12ec 100644
--- a/node_modules/prettier-stylelint/src/index.js
+++ b/node_modules/prettier-stylelint/src/index.js
@@ -60,7 +60,7 @@ resolveConfig.resolve = (stylelintConfig, prettierOptions = {}) => {
prettierOptions.tabWidth = indentation;
}
}
- prettierOptions.parser = 'postcss';
+ prettierOptions.parser = 'css';
debug('prettier %O', prettierOptions);
debug('linter %O', stylelintConfig);
"scripts": {
"postinstall": "patch-package"
yarn add --dev patch-package
yarn install
will now patch the package.It's been months. When is this going to be fixed?
+1
+1. It has been long time. When is this problem going to be resolved?
Hey, anybody?
+1
+1
+1
+1
Anyone working on it??
This is the latest patch, if the above patch doesn't work for you.
diff --git a/node_modules/prettier-stylelint/.editorconfig b/node_modules/prettier-stylelint/.editorconfig
old mode 100644
new mode 100755
diff --git a/node_modules/prettier-stylelint/.gitattributes b/node_modules/prettier-stylelint/.gitattributes
old mode 100644
new mode 100755
diff --git a/node_modules/prettier-stylelint/.npmignore b/node_modules/prettier-stylelint/.npmignore
old mode 100644
new mode 100755
diff --git a/node_modules/prettier-stylelint/.travis.yml b/node_modules/prettier-stylelint/.travis.yml
old mode 100644
new mode 100755
diff --git a/node_modules/prettier-stylelint/CHANGELOG.md b/node_modules/prettier-stylelint/CHANGELOG.md
old mode 100644
new mode 100755
diff --git a/node_modules/prettier-stylelint/LICENSE b/node_modules/prettier-stylelint/LICENSE
old mode 100644
new mode 100755
diff --git a/node_modules/prettier-stylelint/README.md b/node_modules/prettier-stylelint/README.md
old mode 100644
new mode 100755
diff --git a/node_modules/prettier-stylelint/config.js b/node_modules/prettier-stylelint/config.js
old mode 100644
new mode 100755
diff --git a/node_modules/prettier-stylelint/fixtures/find-package/deep/style.css b/node_modules/prettier-stylelint/fixtures/find-package/deep/style.css
old mode 100644
new mode 100755
diff --git a/node_modules/prettier-stylelint/fixtures/find-package/style.css b/node_modules/prettier-stylelint/fixtures/find-package/style.css
old mode 100644
new mode 100755
diff --git a/node_modules/prettier-stylelint/fixtures/less.less b/node_modules/prettier-stylelint/fixtures/less.less
old mode 100644
new mode 100755
diff --git a/node_modules/prettier-stylelint/fixtures/style.css b/node_modules/prettier-stylelint/fixtures/style.css
old mode 100644
new mode 100755
diff --git a/node_modules/prettier-stylelint/index.js b/node_modules/prettier-stylelint/index.js
old mode 100644
new mode 100755
diff --git a/node_modules/prettier-stylelint/src/cli.js b/node_modules/prettier-stylelint/src/cli.js
old mode 100644
new mode 100755
diff --git a/node_modules/prettier-stylelint/src/index.js b/node_modules/prettier-stylelint/src/index.js
old mode 100644
new mode 100755
index 124c00d..a6f12ec
--- a/node_modules/prettier-stylelint/src/index.js
+++ b/node_modules/prettier-stylelint/src/index.js
@@ -60,7 +60,7 @@ resolveConfig.resolve = (stylelintConfig, prettierOptions = {}) => {
prettierOptions.tabWidth = indentation;
}
}
- prettierOptions.parser = 'postcss';
+ prettierOptions.parser = 'css';
debug('prettier %O', prettierOptions);
debug('linter %O', stylelintConfig);
diff --git a/node_modules/prettier-stylelint/src/utils.js b/node_modules/prettier-stylelint/src/utils.js
old mode 100644
new mode 100755
diff --git a/node_modules/prettier-stylelint/test.js b/node_modules/prettier-stylelint/test.js
old mode 100644
new mode 100755
diff --git a/node_modules/prettier-stylelint/tests/error-after-format.css b/node_modules/prettier-stylelint/tests/error-after-format.css
old mode 100644
new mode 100755
diff --git a/node_modules/prettier-stylelint/tests/error-syntax.css b/node_modules/prettier-stylelint/tests/error-syntax.css
old mode 100644
new mode 100755
diff --git a/node_modules/prettier-stylelint/tests/less.less b/node_modules/prettier-stylelint/tests/less.less
old mode 100644
new mode 100755
diff --git a/node_modules/prettier-stylelint/tests/nestes.css b/node_modules/prettier-stylelint/tests/nestes.css
old mode 100644
new mode 100755
diff --git a/node_modules/prettier-stylelint/tests/rules/color-no-invalid-hex.css b/node_modules/prettier-stylelint/tests/rules/color-no-invalid-hex.css
old mode 100644
new mode 100755
diff --git a/node_modules/prettier-stylelint/tests/test-disable-rules.css b/node_modules/prettier-stylelint/tests/test-disable-rules.css
old mode 100644
new mode 100755
diff --git a/node_modules/prettier-stylelint/yarn.lock b/node_modules/prettier-stylelint/yarn.lock
old mode 100644
new mode 100755
We faced the same issue after bumping up our prettier
to version 2.3.2
, prettier-stylelint --write
threw the same error.
Although I don't even understand why but using stylelint-prettier seems to work for us π We installed the package:
npm install --save-dev stylelint-prettier
Then just added this to our .stylelintrc.js
{
"plugins": ["stylelint-prettier"],
"rules": {
"prettier/prettier": true
}
}
I'd love to know if anyone tried the same and success and can explain what happens under the hood π
Will this be fixed or is it safe to consider this package to be abandoned?
I use prettier-stylelint to let prettier formart my scss files using my stylelint rules. I have a problem since I upgraded from v 1.19.1 to 2.0.4 I have found that there was a similar issue with prettier-atom while ago: https://github.com/prettier/prettier-atom/issues/388
Environments:
prettier-stylelint --write --quiet 'src/*/.{css,scss}'"
Expected behavior: to pass all the formatting without throwing an error
Actual behavior: I got an error: prettier-stylelint [ERROR]: There was an error formatting "src/index.scss"
Error: Couldn't resolve parser "postcss" at resolveParser (/Users/myname/repos/project/node_modules/prettier/index.js:11341:15) at normalize$1 (/Users/myname/repos/project/node_modules/prettier/index.js:11436:18) at formatWithCursor (/Users/myname/repos/project/node_modules/prettier/index.js:15032:12) at args (/Users/myname/repos/project/node_modules/prettier/index.js:50675:12) at Object.format (/Users/myname/repos/project/node_modules/prettier/index.js:50695:12) at resolveConfig.then/Users/myname/repos/project/node_modules/prettier-stylelint/src/index.js:129:30)