Skip to content

<!-- eslint-disable --> does not work in the v1.0.0-beta.6 #69

Closed
@vsemozhetbyt

Description

@vsemozhetbyt

1. I've found an error on the v1.0.0-beta.4: <!-- eslint-disable some-rule --> completely disables parsing the whole fragment and even the next fragment:

test.md

### Heading

Text

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

` ``

` ``js
console.log('b')

` ``

` ``js
console.log('c')

` ``

Error log:

   6:1   error  Use the global form of 'use strict'     strict
   6:17  error  Missing semicolon                       semi
  11:1   error  Use the global form of 'use strict'     strict
  11:17  error  Missing semicolon                       semi
  16:1   error  Use the global form of 'use strict'     strict
  16:17  error  Missing semicolon                       semi

test.md with comments:

### Heading

Text

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

` ``

` ``js
console.log('b')

` ``

` ``js
console.log('c')

` ``

Error log (semi errors for the fragments 1 and 2 are not reported; fragment 2 is ignored):

  17:1   error  Use the global form of 'use strict'     strict
  17:17  error  Missing semicolon                       semi

2. So I've tried to update to v1.0.0-beta.6 and make a PR for Node.js. v1.0.0-beta.6 seems to fix this issue, but it has a new breaking one: code blocks with <!-- eslint-disable --> are parsed and throws if parsing errors found:
test.md:

### Heading

Text

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

` ``

Error log:

  7:18  error  Parsing error: Unexpected token bang

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions