Skip to content

Create .prettierrc #4670

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

Closed
wants to merge 1 commit into from
Closed

Create .prettierrc #4670

wants to merge 1 commit into from

Conversation

pushkine
Copy link
Contributor

This file is used in case you have the prettier extension installed and you format the file you're working on
https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode
I'm not asking to reformat the whole thing, or to have those options precisely, I just want a preset common to the project, so as to make it consistent looking

The options as is are compatible with the linting, I'd like the semi linting rule removed however, doesn't make much sense to keep it enabled
one-var also, but that might be more touchy I guess

@Conduitry
Copy link
Member

This was specifically removed a couple of months ago - see #4378.

@pushkine
Copy link
Contributor Author

So the problem was that it breaks lines in long template literals ?
Why not increase printWidth instead of removing formatting from the whole project ?

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this file should follow the defaults from the official options found here - https://prettier.io/docs/en/options.html with the exception of adding "useTabs": true and "tabWidth": 4 The Prettier - Code formatter extension does not follow them and thus they should be inserted from a file. I personally use a .prettierrc file with the following inside, however I keep it in a parent directory, in order not to produce opinionated repositories:

{
	"arrowParens": "always",
	"bracketSpacing": true,
	"endOfLine": "lf",
	"htmlWhitespaceSensitivity": "css",
	"insertPragma": false,
	"jsxBracketSameLine": false,
	"jsxSingleQuote": false,
	"printWidth": 80,
	"proseWrap": "preserve",
	"quoteProps": "as-needed",
	"requirePragma": false,
	"semi": true,
	"singleQuote": false,
	"svelteAllowShorthand": true,
	"svelteBracketNewLine": true,
	"svelteSortOrder": "scripts-styles-markup",
	"svelteStrictMode": true,
	"tabWidth": 4,
	"trailingComma": "es5",
	"useTabs": true,
	"vueIndentScriptAndStyle": false
}

@Conduitry
Copy link
Member

None of the core maintainers are going to be using Prettier when editing the code, probably. The ESLint rules provide adequate, and less opinionated, formatting guidance. We don't want to have an 'optional' prettierrc file, and we don't want people submitting PRs that change 8,000 extra lines because they did happen see the prettierrc file and use Prettier. Ultimately this comes down to maintainer preference, and as a whole the maintainers prefer ESLint alone over ESLint + Prettier.

@Conduitry Conduitry closed this Apr 15, 2020
@pushkine pushkine mentioned this pull request May 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants