Questions tagged [prettier-eslint]
140 questions
0
votes
1 answer
WebStorm change single quotes to double when there is an apostrophe when commit
After I commit a file, my IDE WebStorm changes the string 'We can\’t' to "We can’t" How can I prevent this ?
I already do Preferences -> Editor -> Code Style -> TypeScript -> Punctuation
And put 'single' quotes 'always'

Ursule Maffo
- 1
- 1
0
votes
1 answer
Atom Prettier adds dependencies in useEffect at auto save
I have prettier installed in my Atom editor. I enabled autosave option. but on auto save when it changes useEffect dependency array most of time. I don't want atom to auto add element in dependency array. I would really appreciate if someone can…

Mani
- 2,391
- 5
- 37
- 81
0
votes
0 answers
Prettier/VSCode breaking the syntax
I am trying to format a js file with prettier but it seems prettier is breaking the code syntax. I want to achieve this
(expectated result) but the red lines appear. On save I get the following result. While running the code I get the following…

Gopal Dahale
- 13
- 1
- 1
0
votes
1 answer
What is meaning of the 2 and never param in comma-dangle?
What is the usage of this ?
"comma-dangle": [ 2, "never" ],
What is 2 and never here?

Aakash
- 1
0
votes
0 answers
How to allow one white line after an opening brace in ESLint-prettier?
My typescript code is setup with eslint-prettier. I'd like to have the option of formatting my functions to look like this:
function Name(){
// First line
...
}
... rather than always having to look like this:
function Name(){
// First…

Magnus
- 3,086
- 2
- 29
- 51
0
votes
0 answers
Insert new line at the end of .vue files
I have an issue with prettier + eslint in a Vue project with Typescript. Everything is working as expected except one thing, insert new line at the end of the file.
Insert `␍⏎`eslintprettier/prettier
Newline required at end of file but not…

javifm
- 705
- 4
- 9
- 20
0
votes
1 answer
How to use WebStorm FileWatcher for current file only
I want to create a custom WebStorm Filewatcher rule that performs prettier-eslint on save for the currently edited file. For my arguments, is there a way to declare that the command should be used for only the current edited file? You can see below…

Jimmy
- 3,090
- 12
- 42
- 99
0
votes
1 answer
prettier-eslint in typescript files runs twice and have confilicts with eslint rules
I have problem with configuration prettier and eslint. Example function:
const foo = () => {
[1, 2, 3].forEach((element) => {
console.log(element);
});
};
When I save parentheses are removed from element and I receive an error:
"Expected…

Pr0thean
- 23
- 6
0
votes
1 answer
ESLint "Unexpected token )" also eclipsing other problems in file
I'm implementing ESLint along with Prettier in a React project, and the below code is giving a frustrating parsing error.
ReactDOM.render(
,
document.getElementById('tier_comparison_app'),
);…

Gus Murphy
- 318
- 3
- 11
0
votes
1 answer
VS code with different behaviors
I am working on a FE project with Angular and Vs Code.
We have a .vscode with a extensions.json and setting.json.
And Git is detecting some annoying changes on this code, like the below:
How it was:
return new MyClass.Option(
{
…

Estevao Santiago
- 793
- 2
- 7
- 30
0
votes
1 answer
Disable Prettier from formatting inline JS in HTML files in VS Code
I'm running Prettier through ESLint using the eslint-config-prettier and eslint-plugin-prettier packages. I also have Prettier as a dev dependency to use on non-JS files. I use these two extensions with VS Code to validate and format my code…

Tom T
- 314
- 2
- 12
0
votes
1 answer
Configure parserOptions or parser package for ESLint and Airbnb typescript setup
In my Gatsby (React) project I am using typescript. I need to setup ESLint and have to use eslint-config-airbnb-typescript
I am also using Prettier:
prettier (comes with Gatsby), and I installed the following packages:
npm install…

meez
- 3,783
- 5
- 37
- 91
0
votes
1 answer
React props shorthand prettier
There is a react codebase, and I would like to prettify it with the following rule:
Complete the prop shorthands with a value. shorthand => shorthand={true}
Current:
Expected: