Questions tagged [prettier-eslint]
140 questions
1
vote
1 answer
Upgrading @vue/eslint-config-prettier 7.0.0 causes compile error - Error: Failed to load config "@vue/prettier/@typescript-eslint" to extend from
Fought through a bunch of NPM dependency errors, (see below) getting a compile time error, that had very few hits when I google the error message. I'm hoping someone can give me some context on the error.
Now I'm getting this error at compile…

Eric Brown - Cal
- 14,135
- 12
- 58
- 97
1
vote
1 answer
Prettier, React Router 6, useParams hook, unexpected token
I've been smashing my face into this problem the entire morning.
I recently assembled a new project with React 18, React Router 6, TypeScript, Webpack 5, eslint, and prettier.
Things were going fine until I tried out the useParams hook, and now my…

Axle
- 396
- 3
- 19
1
vote
2 answers
Prettier eslint: use 'prettier' or 'plugin:prettier/recommended' with React Typescript airbnb eslint config
In my React Typescript project I updated prettier, eslint-plugin-prettier and eslint-config-prettier to latest version. I am also using eslint-config-airbnb-typescript.
I have below in the extend property inside eslintrc.js:
extends: [
…

meez
- 3,783
- 5
- 37
- 91
1
vote
1 answer
Eslint rule is running multiple times
I'm trying to write an eslint rule that enforces making sure the name property is defined on any classes that extend from other Error/Exception named classes (and fixes them).
As far as I can tell, it works in the astexplorer.net individually, but…

robert.bo.roth
- 1,343
- 3
- 14
- 24
1
vote
2 answers
How to get rid of eslint prettier errors
How do I get rid of this replace error that underline red all over my code?
Also everytime I "fix" all the errors, whenever I save, it show me the same error again.

Cristian Casallas
- 31
- 8
1
vote
0 answers
How to setup flatTernaryExpressions in prettier VSCode?
I have configured prettier for formatting documents in VSCode. When I format document, it formats like below
function fun1(value: string): string {
return
? "string1"
:
? "string2"
:…

hi-ren
- 66
- 1
- 5
1
vote
0 answers
Adding plugin:prettier/recommended to the eslintrc.json the ng lint goes infinite
If I use plugin:prettier/recommended to the exlintrc.json the ng lint goes infinite.
.eslintrc.json
{
"root": true,
"ignorePatterns": [
"projects/**/*"
],
"overrides": [
{
"files": [
"*.ts"
],
…

San Jaisy
- 15,327
- 34
- 171
- 290
1
vote
0 answers
Using ESLint on server files with CRA
In VS Code - When running CRA and setting up a simple file structure with backend and frontend directories, the frontend (React) files are linted automatically by ESLint, but there is no syntax highlighting in the backend server files.
We have tried…

Cheetara
- 529
- 1
- 6
- 19
1
vote
0 answers
Eslint & Prettier conflicts
I am new in eslint and prettier. I have this simple example, when i use "tabWidth": 4 in .prettierrc.json file. i saw error.I order to not have conflicts between them, i installed the eslint-config-prettier. But i still get errors.
Files:
1.…

Rakibul Islam
- 11
- 1
1
vote
1 answer
How can I get Prettier to Let Me Use Tabs
I'm using ESLint and Prettier with the AirBNB style guide.
For the life of me I can't get it to stop yelling at me on every single line of my file to use spaces.
.eslintrc.json
{
"env": {
"browser": true,
"es2021": true
},
…

Justin
- 945
- 12
- 26
1
vote
1 answer
how to configure styled jsx in Eslint
I'm setting up an environment this way to work with a ReactJs/Next.js project that uses 'styled jsx', but eslint can't fix the css flaws in the middle of the code.
How can I best configure eslint to work with the project I'm working on?
{
…

Emerson Oliveira
- 11
- 3
1
vote
0 answers
Extension 'ESLint' cannot format '../../../file.tsx'. How to debug this?
I started a project 3 months ago and since a while my ESLint formatter suddenly stopped working (like 1 week ago). Can't get it to work in any way. I didn't do any package updates. It could be that I have updated the ESLint extension itself and the…

Nick N.
- 12,902
- 7
- 57
- 75
1
vote
0 answers
How to pass data to Custom ESLint rule?
I have written a custom ESLint rule as follows:
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
module.exports = {
…

EnigmaticJohn
- 127
- 7
1
vote
2 answers
ESLint runs prettier twice if config in .eslintrc and .prettierrc
I am trying to solve a problem with battling formatting on save in VSCode.
I do not have prettier installed as a standalone extension. I have eslint installed. I am working with typescript files.
In my editor, I see a warning on trailing commas and…

Greg Veres
- 1,770
- 19
- 28
1
vote
0 answers
Settings mentioned in .prettierrc not working
I am using Eslint and prettier for formatting in my react project. This combination was working fine until now but all of a sudden the prettier has stopped doing the formatting.
However, I can see in the output that prettier is actually running…

prakhar pandey
- 11
- 4