Questions tagged [prettier-eslint]
140 questions
0
votes
0 answers
Prettier Typescript configuration for keeping the object in one line but its type definition in separate lines
I have code with functions of this format:
export const loginService = async ({ email, password }: { email: string; password: string }) => {}
I want all these functions to be formatted in this manner:
export const loginService = async ({ email,…

ishiz
- 61
- 5
0
votes
0 answers
Prettier settings is not working with VSCode
I installed Eslint and Prettier Eslint plugin.
But the file is not formated by my prettier settings on both auto saving and formatting manually( Shift+Alt+F).
Using terminal command yarn eslint **/main.ts --fix is OK.
My example code named…

behtgod
- 251
- 3
- 15
0
votes
1 answer
Eslint / Prettier Ignoring files with .mock extension
I am using Angular with Eslint and Prettier configured for the entire project. All the files are checked correctly according to rules. Unfortunately, the files that have .mock in name are completely ignored. The file is called for example…

Kuba Šimonovský
- 2,013
- 2
- 17
- 35
0
votes
0 answers
How do i disable prettierrc from giving a error for snake_case asking to convert it to camelCase?
I am working on a reactJS project and have added prettierrc file to maintain the coding standards.
The issue i am facing right now is a few of the identifiers are in snake_case and i need to maintain them in the same way, but prettier is flagging it…

Srinidhi Kashyap
- 1
- 1
0
votes
0 answers
Wrote a Custom Eslint Plugin To Find Duplicate Values In A Json File But It's Not Finding The Duplications
I have multiple Json files. People are writing to these files manually. I want to be able to detect the duplicate values inside each file and throw and error.
I want to utilize eslint to do this and integrate the vscode format on save and fix on…

turtur
- 1
- 1
0
votes
0 answers
Angluar + ESLint + Prettier + VSCode formatting issue
We are having some annoying HTML formatting issues using Angular, ESLint and Prettier within VSCode. For example, the following HTML
Vanaf
is rewritten as
Van
af
This introduces…

Kees de Bruin
- 175
- 2
- 16
0
votes
0 answers
eslint failed to load plugin 'import' declared in '.eslintrc.js » eslint-config-airbnb; cannot find module 'typescript/package.json'
I'm trying to set up eslint for a basic React project (Javascript only, no Typescript). When linting my project with npx eslint ./, I get the following error:
ESLint: 8.31.0
Error: Failed to load plugin 'import' declared in '.eslintrc.js…

Matthew Su
- 1
- 1
0
votes
0 answers
Prettier showing unfixable errors after saving
I am making a simple NEXTJS application to study.
I am trying to make a configuration of Prettier and ESLint.
However, while the format on save is working according to the rules I set up, Prettier still shows these errors that are impossible to…
user20983578
0
votes
0 answers
Prettier not working. Already set to default formatter
Getting this error:
Extension 'Prettier - Code formatter' is configured as formatter but it cannot format 'TypeScript React'-files
I've tried in all types of files including typescriptreact, javascriptreact, javascript, etc.
To be more specific, I…

Jae
- 86
- 1
- 11
0
votes
1 answer
How do you reenable esLint squiggly lines after adding Prettier?
Description
I am trying to configure esLint to work with Prettier in VSCode. I am able to successfully install esLint, but when I add Prettier and add it to extends in the esLint config, the squiggly lines provided by esLint disappear. I have…

GeorgeCiesinski
- 191
- 1
- 3
- 11
0
votes
0 answers
Getting error on prettier settings not matching on docs when I put in PR
I added to markdown documents to an existing project and I get error on prettier settings not matching the projects. enter image description here.
I have my settings for prettier on vs code like this enter image description here
I read through this…

Paulieb
- 1
- 1
0
votes
0 answers
VS Code, Angular, ESLint & Prettier: Insert `⏎` prettier/prettier
I know I'm missing something simple, but I have an Angular component with the following inline template:
template: ` `
ESLint is complaining because Prettier is saying there needs be a new line between the opening and…

Eric
- 65
- 1
- 1
- 6
0
votes
0 answers
Problem with the ESlint + prettier configuration
I've been stuck for a few days on a VueMastery tutorial on the "Vue CLI". The tutorial is called "Real World Vue" for those who knows. Two problems occurred to me when I watched the third tutorial. I took the ESlint + Prettier configuration and the…

RENAUD
- 1
0
votes
0 answers
Is there an eslint rule for sorting things other than object keys?
Currently, I use the sort-keys rule for eslint:
"sort-keys": [
"error",
"asc",
{
"caseSensitive": true,
"natural": false,
…

Trevor
- 17
0
votes
0 answers
Stop eslint/prettier warning on CR in Vue Project
Trying eslist/prettier with Vue for the first time, I've disabled prettier but still cannot stop the warnings on 'CR' (picture below). How do I configure to ignore this?
My eslistrc.js file:
module.exports = {
root: true,
env: {
node: true,
…

Mark Johnson
- 17
- 3