Questions tagged [prettier-eslint]

140 questions
3
votes
1 answer

Why is my glob in my npm script not working?

I am trying to create a regex glob for an NPM script. This is what I have: "format": "prettier-eslint --write \"{,!(node_modules|cypressTests)/**/}*.{js,json,vue}\"" And this currently formats all .js, .json, and .vue files that are NOT in the…
mcool
  • 457
  • 4
  • 29
3
votes
2 answers

VS Code with Prettier/ESLint uses wrong indentation

Prettier in VS Code uses the wrong indentation, even after I changed all the places I can think of to a width of "4". Here are my file contents (some are maybe not necessary, but I added them while trying to fix…
Jan-Patrick Ahnen
  • 1,380
  • 6
  • 17
  • 31
3
votes
1 answer

How to disable attributes breaking in element tags with Prettier

I generated a new Vue project using Vue CLI. For the linter option prompt, I chose Prettier. How do I disable the breaking of attributes to new lines? For instance: This is my markup:
Denis Stephanov
  • 4,563
  • 24
  • 78
  • 174
3
votes
1 answer

Global ESLint overrides project ESLint

I have my default ESLint style used in all my projects (it has been set up globally in VS Code preferences file / settings.json), but there are some other projects that have its specific lint configuration (.eslintrc file under the project…
3
votes
2 answers

Delete CR only for TS/TSX files - Prettier ESLint on VSCode 1.46

I Created a React project using Create React Apps' Typescript template, added necessary plugins for ESLint 6.8.0 and configured ESLint and prettier together but whenever I am editing .ts or .tsx files I get the ESLint Error Delete ␍⏎␍⏎`` I have both…
tHeSiD
  • 4,587
  • 4
  • 29
  • 49
3
votes
3 answers

prettier messes up jsx fragments

function App() { return ( <> < Navbar / > < Users / > ); } on hitting ctrl+Save this changes to function App() { return ( < > < Navbar / > < Users / > …
3
votes
1 answer

Slow lint with prettier

Created a new React project. There is almost nothing there -- just SSR, code splitting and a couple of 'hello world!' pages. On top of eslint added prettier. Before I added prettier the lint used to take 10-15 sec. Now I got +2mins for almost empty…
DraganS
  • 2,621
  • 1
  • 27
  • 40
2
votes
1 answer

ESLint and Prettier indent clashing with multi-line class definition

I've got a class definition that is too long for a single line. Prettier tries to wrap it but when it does it adds an indentation, which I think is correct. But ESLint doesn't like this so it throws an indent error. There seems to be no config in…
Dolan
  • 313
  • 1
  • 4
  • 14
2
votes
1 answer

How to Ignore all folders with folder pattern using prettier

When I execute the following command in a root folder of a project, all the files recursively get run as I expect. prettier --write "**/*.{js,ts}" However, I want to ignore all folders that start with ./next or ./old in those subfolders. How can I…
Pete
  • 3,111
  • 6
  • 20
  • 43
2
votes
0 answers

Could an prettier plugin enable the ability to set newline count after imports?

We're using this eslint rule. import/newline-after-import": ["error", { "count": 2 }] It puts 2 newlines after imports, but, when using prettier it immediately overrides and sets the newline spacing to 1. Is this something that could be made…
GollyJer
  • 23,857
  • 16
  • 106
  • 174
2
votes
0 answers

Prettier throwing error in VScode fresh CRA app installation

I installed a fresh install of CRA and also installed eslint and prettier and as well as two packages to make them work smoothly with each other. Eslint is working and active but prettier is not formatting. I get the following error in the…
elMeroMero
  • 752
  • 6
  • 18
2
votes
1 answer

How to add prettier config into eslint config?

Note, I do not want semicolons used in my JS project. YouTube video I tried disabling it in the .eslintrc.cjs file, however the strange thing is that semi: 0 did not work to disable the warnings over missing ;. However semi: false did disable the…
Leon Gaban
  • 36,509
  • 115
  • 332
  • 529
2
votes
1 answer

How to fix setup error eslint/prettier config?

I need help. I'm trying to set up ifint. But I see errors only in the console, I don’t see them in the problems graph and in the code editor I tried to do everything according to the airbnb instructions on github And also to see these errors I need…
2
votes
2 answers

eslint / prettier / eslint-config-react-native-community integration with prettier extension in VS Code

So, I am trying to use ESlint in my react native project. I want to be able to use prettier extension. I have used this command to install my packages npm i -D eslint prettier @react-native-community/eslint-config and added a .eslintrc file. { …
2
votes
0 answers

Configure Prettier to use up the max allowed number of columns if code content will fit

Does anyone know if it's possible to configure Prettier in such a way to use up as much column space allowed, while still respecting the rest of the prettier/lint rules configured? So, if Prettier's printWidth is set to 80 for example, and your code…
1 2
3
9 10