question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Errors on config comments suppressed

See original GitHub issue

From .eslintrc.js:

    strict: ['error', 'global'],
    'unicode-bom': ['error', 'always'],

Test doc 1:

Text

```js
console.log('a');
```

Result 1:

  4:1  error  Use the global form of 'use strict'     strict
  4:1  error  Expected Unicode BOM (Byte Order Mark)  unicode-bom

Test doc 2:

Text

<!-- eslint-disable strict -->
```js
console.log('a');
```

Result 2:

[No errors]
  1. Maybe unicode-bom should be included in unsatisfiable rules.
  2. Why eslint-disable any-other-rule comment also cancels unicode-bom?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
btmillscommented, Sep 4, 2017

I opened #84 to add unicode-bom to the list of unsatisfiable rules. I renamed this issue and will leave it open to see if there’s anything that can be done about errors on config comments pulled in from HTML being suppressed.

1reaction
btmillscommented, Jul 5, 2017

Maybe unicode-bom should be included in unsatisfiable rules.

Agreed. I’ll do that soon.

Why eslint-disable any-other-rule comment also cancels unicode-bom?

The config comment gets transformed and inserted into the code, so what gets linted looks like this:

/* eslint-disable strict */
console.log('a');

The unicode-bom rule still throws an error on line 1, column 1, but the plugin silences all errors thrown on the generated config comments since they’re supposed to be invisible.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Suppressing errors for file from comment · Issue #2606 - GitHub
I have an auto_prepend_file. When I check this file with psalm, it reports "DuplicateFunction" for all functions in this file, and I'd prefer...
Read more >
Suppress code analysis violations - Visual Studio (Windows)
The global suppression file uses the SuppressMessage attribute. From the Error List, select the rules you want to suppress, and then right-click ...
Read more >
Dealing with code issues - Documentation - Psalm
There are two ways to suppress an issue – via the Psalm config or via a function docblock. Config suppression. You can use...
Read more >
Can comments be used in a Valgrind suppression file?
I need to maintain a Valgrind suppression file for a large project. We filter unfixable errors from a tool we link to. It's...
Read more >
Enabling new ESLint rules in a legacy codebase with ...
suppress -eslint-errors is a tool that automatically adds disabling comments to each line with a lint rule violation.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found