-
-
Notifications
You must be signed in to change notification settings - Fork 458
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
Add prettier-eslint integration #70
Comments
Maybe it is an idea to join forces and also move prettier-vscode+prettier-eslint-vscode to the prettier namespace on GitHub? |
I've closed #14 lately. This is already possible with 2 extensions (this one and Eslint) while saving: {
"editor.formatOnSave": true,
"eslint.autoFixOnSave": true
} Maybe luckily because the formatter runs before onsave events It's also possible to setup a keybinding for those steps (not out of the box for now) microsoft/vscode#871 Moving to the prettier org is tracked in #41 and prettier/prettier#781 @RobinMalfait won't mind having more contributors ;-) |
In code you also have those blinking change due to the intermediate changes being printed. I've seen something really nice in your plugin: you infer prettier's settings from eslint's one avoiding duplication and having config in your workspace. 👍 We will have to think about how we handle settings precedence in our case. |
Let me know if you have a speciifc question about what we're doing in prettier-atom. Currently, users can either choose to enable the eslint integration (i.e., use prettier-eslint under the hood) or not (i.e., use regular prettier). In the former case, we basically ignore every setting you've set for prettier because we let prettier-eslint pick it up entirely from the eslint configuration. |
@robwise Thanks for the info. What's happening if there is no configuration available for eslint? |
🤔 I'm not sure how you're getting that. It clearly states:
|
Sorry for the confusion.
|
Ah, gotcha. Yeah, with prettier-atom, we try to make it very simple: If you check the eslint integration button, then none of your other settings matter. That makes things pretty clear. But I suppose it could also make sense if you wanted to fallback to settings in the IDE if eslint is not configured... |
@kentcdodds in fact, some users have requested this. I think it would be okay to do it, although yes, it would be a bit more complicated |
Come to think of it, now that prettier supports no semicolons, I would also like this! 😅 |
@kentcdodds If we somehow allow passing the fallback prettier options to prettier-eslint when invoking it, then I can hook this up pretty easily in prettier-atom. |
I guess we'd do the same thing but call it |
Great! prettier/prettier-eslint#73 👍 Question to prettier-eslint users: |
Use prettier-eslint new option: prettier.eslintIntegration (boolean) code refactor making a type definition file. requirePrettier is now requirePackage(name) fixes prettier#70
Use prettier-eslint new option: prettier.eslintIntegration (boolean) code refactor making a type definition file. requirePrettier is now requirePackage(name) fixes prettier#70
I could have a project with eslint configured, but not prettier-eslint. I would prefer to have it be: default to locally installed version, if it doesn't exist, use the plugin's version. Does that make sense? |
Definitely. So I won't remove the option Does it make sens to load prettier-eslint from the project? If I understand it correctly prettier-eslint will load eslint/prettier from the project if I give it a filePath |
Yeah, I don't expect the output too differ. It's probably fine to just use the plugin's version. |
Thanks for your time. By the way, nice work on your eslint-prettier, I've played around with it in my vscode integration and it's well better than |
Wonderful! Debugging tip: open up Dev tools and set: |
a bunch .... diff --git a/src/types.d.ts b/src/types.d.ts
index f8ef5b9..d0a4ab0 100644
--- a/src/types.d.ts
+++ b/src/types.d.ts
@@ -71,7 +71,7 @@ interface PrettierEslintOptions {
/**
* The level for the logs
*/
- loglevel?: LogLevel;
+ logLevel?: LogLevel;
/**
* Run Prettier Last. Default false
*/ |
As discussed on prettier#70 It seems to be pointless and should avoid some issues.
Thanks so much for doing this. It's great to converge solutions :) |
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. |
The atom plugin has added this (maybe @robwise can give some tips). This way you and @RobinMalfait (who created prettier-eslint-vscode) could join forces to make this package even better!
The text was updated successfully, but these errors were encountered: