Questions tagged [prettier-eslint]
140 questions
0
votes
0 answers
How use eslint to make absolute imports work
I would like absolute imports with @ e.g.
import { Example } from "@/features/file/example";
to work in my project but when I set it to work imports like:
import { z } from "zod";
stopped working. Also eslint should:
sort imports, ensure empty line…

Rolegur
- 55
- 7
0
votes
0 answers
How to set blank line between imports in prettier?
I'm using prettier and Eslint, However there is a format conflict between them.
My Eslint has a rule that set a blank line between imports:
"padding-line-between-statements": [
"error",
{
"blankLine": "always",
"prev":…

Menai Ala Eddine - Aladdin
- 2,364
- 4
- 22
- 46
0
votes
0 answers
Why isn't my prettier custom plugin working?
i am creating new Vscode extention using prettier custom plugin for formatting code as requirement, my whole code work properly even extension is running properly but my plugin file that i describe here can't print consol.log values like node and…

Mohit kavad
- 3
- 3
0
votes
1 answer
How to get ESLint/Prettier to underline errors in code in TypeScript for VS Code
I've installed ESLint and Prettier in my project folder, along with about every add on I could find to help solve the issue. I've also installed and enabled the extensions. However, I don't get any error warning in my files. For example, the…

Scott-MEARN-Developer
- 114
- 10
0
votes
0 answers
Error: Cannot find module 'eslint' when attempting to use Prettier ESLint VS Code extension in a Yarn Berry proejct with yarn linker
Trying to format a file with Prettier ESLint in a worksapce that uses Yarn Berry without the nodeLinker: node-modules, the extension fails with the following error trace:
Error stack trace:
Error: Cannot find module 'eslint'
Require stack:
-…

Emad Omar
- 729
- 9
- 23
0
votes
0 answers
Prettier ESLint - Can I force quotes to both avoidEscape and be consistent?
I have the array:
["R'", "L", "U", "D'", "F'", "B"]
and it keeps getting formatted to use single quotes on only some of the values because the other ones have a literal single quote:
["R'", 'L', 'U', "D'", "F'", 'B']
I don't want to have…

Justin
- 945
- 12
- 26
0
votes
0 answers
Husky git hook deletes changes in unstaged files when lint staged fails
I have installed husky to use it as a pre commit git hook. I am also using lint-staged. My package.json has following scripts:
"lint-staged": {
"src/**/*.{ts,tsx,css,md,json}": "yarn run format",
"*.{ts,tsx}": "yarn run lint:fix"
},
…

Leff
- 1,968
- 24
- 97
- 201
0
votes
1 answer
Intellij - jsx double quotes not applied
I am using intellij and I have started a react typescript project with vite, have added eslint and prettier, as well as lint-staged. After initially having single quotes for everything I wanted to configure double quotes for jsx. I have set up the…

Leff
- 1,968
- 24
- 97
- 201
0
votes
0 answers
How can I auto-format code on save in React project with Prettier and Tailwind CSS sorting?
I am new to react and I don't use prettier generally. I am trying to use the prettier on my react project along with the tailwindcss class sorting. I couldn't find a solution for my problem.
I have checked out the format on save in VS Code. I have…

Bishal Kar
- 21
- 4
0
votes
0 answers
React Native: Prettier stopped underlining in VSCode
I'm on VSCode version 1.78.1 and React Native version 0.69.10. I have the ESLint and Prettier ESLint VSCode extensions both enabled globally. Previously they were working as expected, underlining linting errors in red, prompting for correction, etc.…

gkeenley
- 6,088
- 8
- 54
- 129
0
votes
0 answers
How to make linter or prettier stop breaking line
How can I configure eslint or prettier to stop break useState and object lines?
It is ok if it will break the line when the line is too long, but it keeps doing it event if there is a short useState or a small object as you can see at my…

MishaOk
- 1
- 5
0
votes
0 answers
"Fix this prettier problem" formats code in VSCode, but then once I type the code reverts to previous formatting
I get shown that my code does not have the correct formatting, and click on the red line that shows up. It gives the option to "fix this problem", and it will! But then as soon as I type again, the code reverts back to the formatting that was there…

Alli G
- 1
0
votes
0 answers
How to ask prettier to avoid new line with specific functions?
Prettier is awesome but it can be a handful sometimes. Consider the following piece of logic:
body("name")
.notEmpty()
.withMessage("Name is required")
.isLength({ min: 3 })
.withMessage("Name should be at least 3 characters long")
…

p0lAris
- 4,750
- 8
- 45
- 80
0
votes
0 answers
Eslint resolve error: typescript with invalid interface loaded as resolver
I have an issue that all .ts files have this error on the first import line.
Resolve error: typescript with invalid interface loaded as resolvereslintimport/namespace
Resolve error: typescript with invalid interface loaded as…

kakakakakakakk
- 467
- 10
- 31
0
votes
1 answer
ESLint not applying rules specified in .prettierrc.cjs
I have setup eslint to enforce airbnb rules alongside prettier for stylist rules.
.eslintrc.cjs
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
extends: [
'airbnb-base',
'airbnb-typescript/base',
…

Gurpreet Singh
- 15
- 5