Closed antonreshetov closed 4 years ago
Since no one answered, had to ask Google) May be useful to someone pattern link for download the correct version of the plugin
Thanks for the article - https://tpodolak.com/blog/2017/04/09/downgrading-visual-studio-code-extension/
Curious why you had to downgrade?
@azz I was faced with a similar problem https://github.com/prettier/prettier-vscode/issues/318
The auto-update to 1.1.1 broke prettier-eslint integration for me.
My environment:
Downgrading to 1.1.0 fixed it for me. Here’s how to downgrade if you‘re facing the same problem:
"extensions.autoUpdate": false,
This obviously needs further investigation but if upgrading from 1.1.0
to 1.1.1
causes issues, you could try pinning prettier-eslint
back to 8.3.1
as that's all that happened.
https://github.com/prettier/prettier-vscode/compare/v1.1.0...v1.1.1
If the issue is from 1.1.0
though it is more confusing, because there's nothing obvious in the diff that would cause this: https://github.com/prettier/prettier-vscode/compare/v1.0.1...v1.1.0
Judging by the number of upvotes in a short amount of time on @ryanditjia's comment above, there was obviously an issue with 1.1.1
. @CiGit Do you want to release a patch to rollback while we investigate?
Reverting back to 1.1.0 as mentioned above worked for me too. Thanks.
We are using prettier-eslint-cli@4.4.0
with prettier-eslint@8.7.5
which works with v1.1.0 but not with v1.1.1. I also tried v1.1.1 with prettier-eslint@8.3.1
but it didn't work. It seems the v1.1.1 doesn't care about the "prettier.eslintIntegration"=true
setting.
@ryanditjia Can you share exactly what broke?
We don't pick your local prettier-eslint, we always use ours. @azz I'll make a new rollback release.
I can confirm that the latest version broke the eslint integration.
@azz I am pro releasing a patch while investigating! Something I can help with?
I'm just trying to hack some logging into ~/.vscode/extensions/esbenp.prettier-vscode-1.1.1/node_modules/prettier-eslint/dist/index.js
to investigate.
v1.1.2 on it's way to your editors with prettier-eslint@8.3.1
2018-1-17 22:09:19:
-------------------
ImportDeclaration should appear when the mode is ES6 and in the module context.
Is this relevant?
Awesome, thanks @CiGit anything I can help with to resolve the issue?
@RobinMalfait Well, find out what break. On my tests in was working... Any help welcome
@azz Anything in the output channel is something probably bad as it is catched when throwed. @RobinMalfait 's safeExecution
Now I can't reproduce it :(
(notice the space after foo
which ESLint is correctly inserting)
Does who have an issue with v1.1.1, could you share your eslint config and a piece of code which fails? Or even better, a repository. I can't make it fail whatever that means.
On it, I have one that fails!
@CiGit I have created a repro repo: https://github.com/RobinMalfait/broken-prettier-repro-case
:+1: Thanks @RobinMalfait will do something with it
Once I find some time I'll try to investigate as well!
Just seen your format is: eslint --fix. Shouldn't it compare to prettier-eslint?
@CiGit eslint uses the prettier plugin so it should work. It worked before though. And since prettier-eslint
in essence just runs Code ➡️ prettier ➡️ eslint --fix ➡️ Formatted Code
prettier-eslint [DEBUG]: Unable to find config
If I change the content of your .eslintrc.yml with a simple one, it works ....
It seems it's highly dependent from where prettier-eslint is run. In our case, extension context... As it doesn't find plugins / parser / config, it does nothing. diff
Here’s my repro that fails: https://github.com/ryanditjia/another-broken-prettier-repro-case
It’s an empty create-react-app
with my eslint boilerplate added.
I tried simplifying the eslint config to only include "extends airbnb", but it still reproduces.
EDIT: turning off all extensions except Prettier (or just Prettier + ESLint) still reproduces.
I think I've understood: Your eslint config can't depend on other modules like config, plugin, parser
Here is our .eslintrc
file which works fine with the latest prettier-eslint@8.7.5
as well, running from npm script or a command line.
{
"env": {
"browser": true,
"node": true,
"es6": true,
"mocha": true
},
"globals": {
"expect": true
},
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"experimentalObjectRestSpread": true
}
},
"plugins": ["import", "mocha", "unicorn"],
"extends": ["semistandard", "plugin:import/errors", "plugin:import/warnings"],
"rules": {
"max-len": [
"error",
{
"code": 120,
"ignoreRegExpLiterals": true,
"ignoreTrailingComments": true,
"ignoreUrls": true
}
],
"no-console": "error",
// import: Static analysis
"import/no-unresolved": "off", // does not work with HTML and CSS files just yet
"import/namespace": "off",
"import/no-absolute-path": "error",
"import/no-internal-modules": "off", // pretty extensively used throughout the project
"import/no-webpack-loader-syntax": "error",
// import: Helpful warnings
"import/export": "error",
"import/no-named-as-default": "error",
"import/no-named-as-default-member": "error",
"import/no-extraneous-dependencies": "error",
"import/no-mutable-exports": "error",
// import: Style guide
"import/no-duplicates": "error",
"import/extensions": ["error", "never"],
"import/order": "error",
"import/newline-after-import": "error",
// Mocha
"mocha/no-exclusive-tests": "error",
// Unicorn
"unicorn/catch-error-name": ["error", { "name": "err" }],
"unicorn/filename-case": ["error", { "case": "kebabCase" }],
"unicorn/no-abusive-eslint-disable": "error",
"unicorn/throw-new-error": "error"
}
}
The eslint dep versons:
"babel-eslint": "8.0.1",
"eslint": "4.8.0",
"eslint-config-semistandard": "11.0.0",
"eslint-config-standard": "10.2.1",
"eslint-loader": "1.9.0",
"eslint-plugin-import": "2.7.0",
"eslint-plugin-mocha": "4.11.0",
"eslint-plugin-node": "5.2.0",
"eslint-plugin-promise": "3.5.0",
"eslint-plugin-standard": "3.0.1",
"eslint-plugin-unicorn": "2.1.2",
@zfeher And I think it fails if you run it from the command line from a different project which hasn't your eslint plugins for instance
- your project with that eslint
- folder with only prettier-eslint-cli installed
Yes it fails. Played with it a little bit. If a single plugin is not installed prettier-eslint fails to use the eslint config and falls back to default. However this happens with 8.3.1 and 8.7.5 as well.
Vscode prettier plugin 1.1.2 kinda works the same way, if eslint plugins are missing it will fallback to another default (single quotes instead double, ...), but if plugins are installed it works.
prettier-eslint@8.7.6
is out, please test that version. I do believe it should fix the regression.
Anyone else having problems in conjunction with eslint-config-prettier
?
The VS Code prettier extension stopped working for me on JSON files, while prettier
is working fine via the CLI.
I am on version 1.1.2
of the extension, got prettier.eslintIntegration
set to false
in the VS Code settings + the following npm modules in my project:
npm ls --depth=0 | grep prettier
├── eslint-config-prettier@2.9.0
├── prettier@1.10.2
├── tslint-config-prettier@1.6.0
The according sections of my package.json
are as follows:
"prettier": {
"singleQuote": true
},
"eslintConfig": {
"extends": ["eslint:recommended", "prettier"],
"env": {
"browser": true,
"jquery": true
}
},
If this is another issue and does not belong here, I'm happy to add it as a separate one.
@riddla Other issue, although the title is misleading, this is mostly due to eslintIntegration: true
Due to the huge amount of bugs, linting support has been deprecated in version 2.0.0. See the documentation on the recommended configuration: https://github.com/prettier/prettier-vscode#vscode-eslint-and-tslint-integration
See #870 for more details.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
How to revert to previous version? Where do you even find all versions of the plugin?