Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors on config comments suppressed #75

Closed
vsemozhetbyt opened this issue Jul 4, 2017 · 6 comments
Closed

Errors on config comments suppressed #75

vsemozhetbyt opened this issue Jul 4, 2017 · 6 comments
Labels

Comments

@vsemozhetbyt
Copy link

vsemozhetbyt commented Jul 4, 2017

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?
@btmills
Copy link
Member

btmills commented 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.

@vsemozhetbyt
Copy link
Author

Does this behavior cause #77?

@vsemozhetbyt
Copy link
Author

And maybe also #78?

@btmills btmills changed the title unicode-bom rule Errors on config comments suppressed Sep 4, 2017
@btmills
Copy link
Member

btmills commented 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.

@btmills
Copy link
Member

btmills commented Sep 4, 2017

Without digging in yet, I suspect at least one of #77 or #78 will be due to the parser truncating empty lines from the beginning of code blocks, which would be unrelated.

@btmills
Copy link
Member

btmills commented Feb 11, 2021

I believe the other cases here have been addressed, and I'll close this to track the remaining portion in #115, which I suspect has the same underlying cause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

No branches or pull requests

3 participants