How can I prevent prettier from changing single quotes to doubles? - eslint

If I have a string like this: 'don\'t fix me' prettier will change single quotes to douples: "don't fix me". This is extremely frustrating since our .eslint rules will give errors and I have to manually fix every single string back to 'don\'t fix me' format before I can push to our repository. I can't change prettier or eslint rules as they are managed by seniors. Is there any way to fix this behaviour without messing with .eslintrc or .prettierrc?
I am using VS Code, but haven't found extension to help me here.

Related

VSCode changes ' to " on save (autoSave)

-Edited-
First of all - thanks for the answers.
settings->quote indeed looks like
the right direction.
That being said.. I understand that there is no reality in which I get to keep BOTH my single, AND double quotes,
and just turn off ONLY the quote thing checker/fixer style.
-Original-
My VSCode changes the ['] char to ["] automatically every time it saves.
I have the autosave feature (out of focus, etc.) turned on.
So.. at this point, writing NodeJS is becoming insufferable.
Tried looking through my extensions, settings, and even deleted all the unused and old ones.
Nothing.
I'm down to these 5, and can't seem to find the answer (Of course, "Prettier" was the first thing I checked. so if it's there, I either didn't get it, or missed it.)
In the settings of VS Code, just search for javascript.preferences.quoteStyle to get the exact result. But this is the setting you need to change in order to tell Prettier that you want single quotes instead of double quotes.
You can tell prettier that you prefer single quotes by having a config file (for example, a .prettierrc at the root of your project that has singleQuote set to true. The default is false.
{
"singleQuote": true
}

How to search for a specific position in a JSON file?

I'm trying to import a large JSON file but I'm getting this error:
Unexpected token , in JSON at position 197031914
how do i go to that position to fix it?
Thanks!
Besides the recommendations of using a json linter, this extension lets you navigate to a specific offset (position) within a file. You'd want to go to offset 197031914.
Keep in mind that if the file has very long lines, VS Code will not display the entire line. You can try adjusting this limit by following these steps
Just use a JSON linter. There are plenty online, like this one. The linter will point out the specific errors in the syntax of your JSON file.
I know this is an older question but since its getting some views I want to mention how I ended up solving this issue.
Because I was processing huge files (gigabytes), it was not working with linters, so I ended up solving this issue by writing my script that takes a readable stream and find that position and then return the context (x number of charachters before and after position).
I still use it and I might get around to publish it on npm for others to use. (not sure if someone had already done a similar thing);
Looks like you have a one line file. There is an out-of-the-box command to jump to a line number in VS Code. But there is not for a jump to column. So, simply add this VSCode extension to be able to easily jump to a given column on line.
You can auto-fix by linting from the command line using eslint-plugin-json:
$ npm i eslint eslint-plugin-json
$ npx eslint --fix example.json
NOTE: You can get more info about the issue using npx eslint example.json (before fixing).

How to alter WebStorm smart completion templates

When I add a Class into a Typescript Application, WebStorms Smart Code Completion finds the reference and creates an import reference automatically.
This is great, but the format is different to the TSLinter, I was wondering if there is a way of altering the generated code so that it will use single quotes instead of double quotes
Thank you #LazyOne, I altered this setting and now single quotes are used. It may be a little bit to much as it will effect all TypeScript string insertions, but I will try this for now.

LaTeX document errors where no errors exist

I am writing my thesis with LaTeX and since today very curious errors turn up. I wrote something and made a citication in the file references.bib, and then the errors turned up. Befor writing that few lines everything worked great. Thus, I deleted everything I've added. But the errors still turn up. One Error is: Extra }, or forgotten $. ...ckoverflow Permission SYSTEM_ALERT_WINDOW}. I think my citication (which I've deleted after the errors turned up) is still stored somewhere , because "ckoverflow Permission SYSTEM_ALERT_WINDOW" was a part of the title of the cite.
I hadn't found any error in any file.
The next weird thing is that a mate of mine can compile that files without any problems. He is using WinEdt. I am using TeXStudio, but I've tried it with WinEdt, too.
There is a screenshot of my errors:
Please help me, any suggestions are appreciated.
Best regards
Looks like you might need to escape your _ characters there, as they are normally used for subscript, but only in math mode; hence the "missing $ inserted".
(La)TeX error messages make me sad... :(

Mediawiki/wikipedia text format issue

so i got an issue with text formatting and i have no idea how this problem is called or what i should search after, so i thought i try to explain it here.
It's literally nothing dramatic or should take long, i simply want to write stuff like
''italic'' or '''bold'''
without that it actually gets italic or bold... i literally want
''italic''
to be displayed. I've also tried to use code blocks but even within the blocks it writes italic then.. i'm sure there is a <..> command but i simply can not find it
Does anyone know?
try this:
<nowiki>''italic''</nowiki>

Resources