TSLint - how to avoid that all my code underlined in red? - intellij-idea

I loaded an angular project in ItelliJ and all the files have some code underlined in red.
The same red colour is on the scrollbar on the right.
It seems the code is full of errors, but they are just missing spaces or things like that; the project is correctly builded.
Even comments that don't have a space after the // get underlined in red.
The responsible is TSLint.
This distracts me; I would like to have underlined code only for "real" problems, and maybe yellow suggestion on the left (and not in scrollbar) for missing spaces in comments or import.
I found this (here https://github.com/Microsoft/vscode-tslint/issues/199)
tslint.alwaysShowRuleFailuresAsWarnings
but it's in visualStudio and I don't know where to add this option in intelliJ.
Do you know how to disable this red underlining?
Also another question, if I would disable TSLint, do I loose anything except formatting?
I like to have a well-formatted code, but from the IntelliJ environment I would like to have mostly the syntax errors rather than formatting, at least not in real time (maybe i can run to check the code formatting when I want, as I did until now).
Here the screenshot as requested by the first answer. The settings are ignored, maybe there is a problem in my computer... (TLSint is 5.0.0 by the way)

The editor highlights the errors according to the severity levels specified in the TSLint configuration files by default. You can either set warn as defaultSeverity ({"defaultSeverity": "warn"}) in your tslint.json or override it with a specific severity in IDE settings (Settings | Editor | Inspections | TypeScript | TSLint): uncheck Use rule severity from the configuration file to use the inspection severity for all linter rules:
if I would disable TSLint, do I loose anything except formatting
If you are mostly interested in syntax errors, you can safely disable TSLint

Related

PhpStorm AutoComplete code is not working

I'm using PhpStorm over 3 months and it's a good IDE. I do not know what I've clicked yesterday but since yesterday I have issue with code completion in CSS mainly.
On the screen I have VS Code and PhpStorm and also I've opened the same project.
In VS Code it works perfectly. In PhpStorm it doesn't. I tried some Google First Aid like clear cache, update the IDE, turn On/Off Safe mode etc. but nothing changed.
My Code Completion settings:
Based on your PhpStorm editor area screenshot (many thanks for that BTW: not many people do post it even if asked), all your CSS files are treated as a Plain Text. It's rather unlikely to be a glitch, more like accidental settings change.
Settings/Preferences | Plugins -- make sure that CSS plugin is enabled. If not -- enable and restart the IDE.
If still the same: Settings/Preferences | Editor | File Types -- locate "Cascading style sheet" entry and make sure that it has *.css pattern there.
If not there -- it's possible that you have somehow reassigned it to "Text" file type. If it's there -- just add *.css to Cascading style sheet patterns (it will remove it from Text when doing that).
If still nothing: you would need to provide more/new screenshots.

PhpStorm is doing something with blank lines so that they are shown as changes in my commits

Basically after changing files in PhpStorm and commiting I get a lot of these blank line changes but I haven't touched any of them.
I turned on "keep indent on empty lines" and turned off "remove trailing spaces" but it didn't fix the problem.
What's going on here? For now I have to stage lines instead of whole files to avoid pushing garbage changes but that's less than ideal.
I turned on "keep indent on empty lines" and turned off "remove trailing spaces" but it didn't fix the problem.
Settings/Preferences | Editor | General | Remove trailing spaces on: is indeed the option that controls such behaviour. As per your description you already have that disabled.
If you have .editorconfig files in your project then corresponding setting from there (trim_trailing_whitespace) will overwrite corresponding IDE settings. It is expected as it's the whole nature of such files.
In this case you have a few options here:
either edit your .editorconfig file accordingly (https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties#trim_trailing_whitespace)
or disable such support in the IDE (Settings/Preferences | Editor | Code Style | Enable EditorConfig support)
or even more radical one: disable EditorConfig plugin completely (which affects the whole IDE: all projects / code styles).

Pycharm / Jetbrains product odd highlighting. Any idea what is being highlighted?

I'm having a weird problem in pycharm that I can't seem to work out.
Using the Darcula theme, I'm seeing some odd highlighting as seen in the below image
Any idea what it is? I'm thinking I must have accidentally turned on some obscure tool, but I can't spot any rhyme or reason.
For whatever reason / somehow you have injected custom language (HTML?) into DIV (?) tags (the green background).
Settings (Preferences on Mac) | Editor | Language Injections -- find and delete offending rule. It should have "Project" or "Global" in most right column (Scope) -- do not touch "Bundled" ones.
Alternatively -- Alt + Enter while having caret inside problematic place and choose "Uninject xxx" from popup menu. This will only disable that rule (which is still enough to make it work as before) .. but you better delete such wrong rule at some point later.

Ignore whitespace changes in IntelliJ changebars

I have a file from our repository where I ran auto-indent (because it was a mess), and now the whole file is marked by blue changebars (down the right hand side of the editor window), making it difficult to find my changes.
I am already ignoring whitespace changes in the diff window (as described here: Intellij and changes tab), is there a way to also do this in the editor window?
I couldn't find a way to completely ignore whitespaces, but IntelliJ (I'm using version 2016) lets you set an option to color whitespace-only changes differentely:
Editor -> General -> Different color for lines with whitespace-only modifications
which helps tremendously.
At the moment [idea 13.5] it seems that is not possible to ignore spaces in the standard editor. You can open a support ticket
We also faced this in the company due the different codestyles used, at the end we settle for:
setting a common codestyle that everyone editing the code should [actually must] follow
reformat the whole codebase to the given codestyle
recommit the formatted code [without any addition or deletion, just the reformat]
It took just a bit of time, but at the end now we are working far better. In this way from that moment onward, we would have all the time the code that would aesthetically the same trough next versions.
You can completely disable the highlight of whitespace modified lines in :
Settings -> Editor -> Color Scheme -> VSC -> Editor Gutter -> Whitespace-modified lines
And then uncheck the background color :
Essentially, you want Intellij to use the --ignore-all-space or --ignore-space-change upon a merge.
My developer team also deals with this challenge because we have different code formatting preferences. The result is every merge is painful for no reason. The team loves being able to have their code formatting, but this negates it.
As of now there is no solution. Intellij has the technology to ignore whitespace, so fixing this is really just adding a check box on the merge diff screen or even in the version control settings.
There is a feature requests IDEA-107714
Please up vote it!
https://youtrack.jetbrains.com/issue/IDEA-107714
Try this,
View --> Active Editor --> Show whitespaces
this is guaranteed to solve your problem

Highlight lines that are too long

In vim, I can create a rule that highlights lines that are over 80 characters long. Can I do this in IntelliJ? Here's an example in vim:
I don't know if you can highlight. You might have to write a custom Code Inspection for that. But in Settings -> Code Style you can set a right margin of 80 characters and force automatic wrapping once you reach it.
Infact in Settings -> Code Style -> Java under the Wrapping and Braces Tab
there is the option Ensure right margin is not exceeded.
IntelliJ (at least v2016.2 and newer) has exactly this feature.
Under preferences go to: Editor -> Inspections -> General,
Then select: "Line is longer than allowed code style".
You can choose the severity you want, for most severities IntelliJ will underline the characters that exceed the line length limit (but you could change the style of the severity to look exactly like vim if you wanted).
(If it doesn't work, make sure "Right margin (columns):" is set under preferences Editor -> Code Style.)
You could add the JSLint Code Quality Tool.
You can set a maximum line length with that tool... if you so desire, you could disable everything else.
Then, in the Inspections part of your Project settings, enable the JSLint Inspection and set it to whatever Severity you like. This will probable highlight the whole line, but that's close enough, right? :)
I'm sure you've have already resolved this, Rose, but for other people who stumble upon this post, Raystorm's answer was correct. However, in order for the automatic line wrapping to occur, you must auto-format the code by typing Ctrl-Alt-L.