Eslint redundant warnings - eslint

I have a lot of redundant and strange output from eslint and I don't know how it can be disabled. On the screenshot below you can see that there are 5 or 6 repeated problems in every file that not related to actual problems with code.
For example first line of every file contains this warning.
Rule 'no-reserved-keys' was removed and replaced by: quote-props
In .eslintrc rule quote-props is disabled.
"quote-props": 0
But no-reserverd-keys rule enabled instead
"no-reserved-keys": 1
They defined in additionalRuleMetadata section:
"no-reserved-keys": {
"severity": "w",
"help": "http://eslint.org/docs/rules/no-reserved-keys",
"priority": "major",
"category": "Possible Error"
},
"quote-props": {
"severity": "i",
"help": "http://eslint.org/docs/rules/quote-props",
"category": "Stylistic Issue"
},
So the question is. How to get rid from these redundant warnings?

It appears you're defining ESLint 1.0 rules but are using ESLint 2.0.
According to the ESLint docs for no-reserved-keys:
Replacement notice: This rule was removed in ESLint v1.0 and replaced by the quote-props rule.
You can remove the no-reserved-keys rule from your ESLint configuration, but leave the quote-props as is and the redundant warnings should go away.
The same is true for:
space-return-throw-case
no-wrap-func
global-strict
no-empty-label
Each was replaced with the rule mentioned in the warnings you're seeing. More info on migrating to ESLint 2.0.

Related

Ignore flake8 warning in SublimeLinter

I have installed SublimeLinter-flake8. I would like to exclude the W191 warning when I am using SublimeLinter with flake8. I have checked the SublimeLinter docs and tried adding "--ignore W191" to my user settings file and reloaded plugins but I still get warned about the usage of tabs.
The following is my Packages/User/SublimeLinter.sublime-settings file.
// SublimeLinter Settings - User
{
"linters": {
"linter_name" : {
"args" : "--ignore W191"
}
}
}
I checked this answer on StackOverflow but I would like it to be applied from the settings file.
The linter_name has to be the specific plugin you're looking to configure (in this case flake8) -- try this:
{
"linters": {
"flake8" : {
"args" : "--ignore W191"
}
}
}
though realistically, it is probably better to configure your flake8 settings in flake8's configuration such that contributors to your project can work on your project without your specific sublimetext settings. I believe sublimetext's invocation of flake8 should be compatible with those configurations if I'm reading their code correctly
disclaimer: though I'm not sure it's super relevant here, I currently maintain flake8

"SublimeAutoPep8: some issue(s) were not fixed" such as E501

I'm getting a soft warning in Python:
SublimeAutoPep8: some issue(s) were not fixed:
File "/Library/WebServer/dir/dir/filename.py", line 11: not fixed E501
File "/Library/WebServer/dir/dir/filename.py", line 33: not fixed E501
My current AutoPep8.sublime-settings is:
{
"format_on_save": true,
"max-line-length": 100,
}
I've tried adding the following config in Preferences.sublime-settings:
"pep8": {
"#disable": false,
"args": [],
"excludes": [],
"ignore": [ "E251", "W291", "E501" ],
"max-line-length": null,
"select": ""
},
doesn't seem to be right though.
What should I do to ignore these warnings? Thank you!
Firstly you should not be adding your AutoPep8 settings in Preferences.sublime-settings instead they should all be added to the AutoPep8.sublime-settings file which should be located in your Sublime Text User config directory.
Secondly I think you may have muddled up the settings of 2 different Sublime Text packages, those being Auto​PEP8 and Python PEP8 Autoformat. Given the warning message you mention it seems reasonable to assume you installed AutoPep8 but the settings you show are a combination of the 2 packages, see the default AutoPep8.sublime-settings file and the default pep8_autoformat.sublime-settings file. Both packages have an ignore setting but the Python PEP8 Autoformat package expects a list of strings, which is what you used, while the AutoPep8 package expects a string of comma separated values, which is what I think you should have used.
You should be able to open your user AutoPep8.sublime-settings file using the Sublime Text menu:
Menu --> Preferences --> Package Settings --> AutoPep8 --> Settings – User
I suggest you try these AutoPep8.sublime-settings settings:
{
"format_on_save": true,
"max-line-length": 100,
// Crucially "ignore" uses a string with comma
// separated values and not a list of strings.
"ignore": "E251, W291, E501"
}

Parsing error: Invalid regular expression: /\p{Lu}/: Invalid escape (Unicode general category properties)

ESLint 7.0.0 appears to have a problem with Unicode general category properties in regular expressions.
In one file, I'm getting this error message:
Parsing error: Invalid regular expression: /\p{Lu}/: Invalid escape
I'm getting it in other files as well, but this is the most simple expression on which I'm getting it.
It's a valid expression. Works just fine when I run the code. But it's breaking my ESLint run.
What setting do I use to get ESLint to accept these expressions?
Problem seems to disappear by adjusting .eslintrc.json slightly:
"parserOptions": {
"ecmaVersion": 2019
}

How to disable eslint error "Expected imports instead of AMD define(). "

How to disable Eslint rule "Expected imports instead of AMD define()? " So that eslint wont report.
The easiest way to disable a rule is to turn it off in your configuration file (This is an example .eslintrc.json file):
{
/* Your specific configuration */
"rules": {
"#typescript-eslint/no-function-return-type": 0 // Here I manually override this specific rule
/* The rest of your rule overrides */
}
}
From the official ESLint documentation:
"off" or 0 - turn the rule off
"warn" or 1 - turn the rule on as a warning (doesn’t affect exit code)
"error" or 2 - turn the rule on as an error (exit code is 1 when triggered)
In your case I believe this rule is giving you the error, so to turn it off just specify the following in your ESLint config:
import/no-amd: 0

Puppet not executing catalogs

So I have this issue wherein my puppet master generates a catalog, this catalog is sent to the server which then runs it, but then nothing happens.
I did a printout with:
puppet master --verbose --compile billyjean > derp
{
"tags": ["class","file","authorized_keys","node","billyjean"],
"type": "File",
"parameters": {
"source": "puppet:///modules/basetoolkit/ssh/authorized_keys",
"ensure": "file",
"path": "/home/ubuntu/.ssh/authorized_keys",
"require": "File[sshfolder]"
},
"exported": false,
"file": "/etc/puppet/manifests/site.pp",
"title": "authorized_keys",
"line": 122
},
So I am expecting it to copy my authkeys to the machine from location "modules/files/basetoolkit/ssh/authorized_keys" to the server, but nothing happens. It also seems there are other things that are not being run, but for now I am testing with this as it is the most non-critical.
On the client check
/var/lib/puppet/state/last_run_report.yaml
There is probably some problem with the code you are attempting to apply on the client
By carefully reading this quite verbose file you should see a clue to what the problem is
Seems to have worked to remove inheritances and other stuff that is deprecated or marked as "don't use", but for some reason still in most of the manual:
http://docs.puppetlabs.com/puppet/latest/reference/lang_node_definitions.html#inheritance

Resources