Editor confuses eslint comments


#1

I have eslint comments in my code (which are then used in the console with the eslint command)

Configuration for rule "no-console" is invalid:
Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self'
      https://apis.google.com
      https://cdnjs.cloudflare.com
      https://cdn.segment.com
      https://ajax.googleapis.com
      https://*.kissmetrics.com
      'sha256-aROmP5KBVON8dHdF7kTobxNwhI67hJuBpk+jNh/jbM4='
      'sha256-lIXJkTrfgeKmujhwsIkqzNbMkplZdPFm1ERXsf46uOw='
      'sha256-+4l9lhP1UV/0AkyBaWekYrPjOAwL8g5JIOD76yrrOHE='
      'sha256-To0Iwo79L42agXa29pvaAn64gM4rwT1BflbRPGdqcUg='".

I get a really quick-flashing error (this took some time to copy). How can I fix this?
And also how can I disable ALL linting errors (like unexpected token) for a specific line? I tried // eslint-disable-line and also // jshint ignore:line without success.


#2

Note: The “confusion error” did not happen until like a week ago


#3

Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self'
Please read this.

You cannot use unsafe-eval. Eval is horribly unsafe

  • I dont really know abouy elint and jshint but this is what I think is happening
  • Also I reccoment to search for a other module. Or replace the thing that eval is doing.

#4

Ok to clarify, no eval is used. The only thing eslint evals is the inline-comments array (which I wonder why it does, json exists…). Anyways I renamed my eslint config to .eslintrc.json which made the editor use all my rules! This is so awesome now I can code my style and then auto-fix using the console.