Comments (14)
There are two ways of using Prettier and ESLint at the same time:
-
Let Prettier handle the formatting of your code, and turn off all stylistic rules in ESLint (because they mostly conflict with Prettier, like in your case). eslint-config-prettier helps doing this.
-
Use prettier-eslint. This runs Prettier first, and then
eslint --fix
. This is if you disagree with some code formatting choice that Prettier has made, and want ESLint to automatically adjust that.
It looks like you are currently using method 1, but actually want method 2. So try out prettier-eslint!
from eslint-config-prettier.
.prettierrc
"breakBeforeElse": true
.eslintrc.js
'brace-style': [
'error',
'stroustrup',
{
'allowSingleLine': true
}
],
from eslint-config-prettier.
Hello everyone!
Today I released a prettier plugin, maybe this will help.
from eslint-config-prettier.
The same problem still occurs here, even with the suggested configurations...
Any further ideas of how to solve this issue?
from eslint-config-prettier.
@mmorgan4x When I first created the plugin, it reflected my tastes a bit; I dislike single-line blocks, so I didn't implement the allowSingleLine
option. 😂
Now that I think about it again, it is very difficult to implement considering the internal logic of the current plugin.
@JounQin We talked about the prettier plugin I created. Please refer to this comment. 😆
from eslint-config-prettier.
@lydell Thanks for taking the time and effort to respond to my question. I really appreciate it. Things are much more clear from your explanation now thank you so much.
🍰
from eslint-config-prettier.
@ony3000 I was about to write my own plugin, how convenient
from eslint-config-prettier.
Hello everyone!
Today I released a prettier plugin, maybe this will help.
Thanks a lot)
from eslint-config-prettier.
I hated the 1tbs
style
@ony3000 You're a life saver buddy! Thanks!
from eslint-config-prettier.
Could we see this being added? What solution do other people use for this? Would like to have simple allman case formatting in CSS & Javascript
from eslint-config-prettier.
This is no such option for prettier at all.
from eslint-config-prettier.
any solution?
from eslint-config-prettier.
@ony3000 does the plugin support the option for allowSingleLine": true
as well? If not can it?
from eslint-config-prettier.
No idea What's your meaning, it's a 7 years old issue. 😆
from eslint-config-prettier.
Related Issues (20)
- ESLint Flat Config HOT 1
- Prettier 3: HOT 2
- New prettier update breaking Eslint plugin? HOT 2
- Turn off only necessary rules in vue/html-self-closing HOT 1
- TypeError: prettier.getFileInfo.sync is not a function HOT 1
- max-statements-per-line HOT 4
- Compatibility with eslint config
- Definition for rule 'prettier/prettier' was not found HOT 7
- Configuration with @stylistic/eslint-plugin HOT 4
- This bug is missing information needed to diagnose the problem. Please see our [guide on how to open a good issue](https://github.com/prettier/prettier-vscode/wiki/Writing-a-Good-Issue) and provide the missing information. Most configuration-related issues can only be resolved by [providing a full repro](https://github.com/prettier/prettier-vscode/wiki/Writing-a-Good-Issue#5-provide-a-sample-github-repo). **If you don't provide a sample to reproduce your issue, your bug will most likely be closed.** HOT 1
- [meta] maintenance question HOT 6
- Docs: Clarifying when this config is useful as a config? HOT 3
- maintenance: use `changesets` for releasing automatically
- Conflict with `vue/first-attribute-linebreak` not handled HOT 2
- Remove `unicorn/template-indent` HOT 3
- Turn off `lines-between-class-members` and `@typescript-eslint/lines-between-class-members` HOT 1
- Support `@stylistic/eslint-plugin` HOT 1
- Conflict with import/newline-after-import HOT 5
- [CLI] Handle undefined computed config
- about eslint9.x HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eslint-config-prettier.