highlightjs / highlight.js

JavaScript syntax highlighter with language auto-detection and zero dependencies.
https://highlightjs.org/
BSD 3-Clause "New" or "Revised" License
23.31k stars 3.52k forks source link

Linting error for all pull request automated testing #3915

Closed dschach closed 7 months ago

dschach commented 8 months ago

Describe the issue/behavior that seems buggy

https://github.com/highlightjs/highlight.js/blame/3d5d07e0c93f79df33f18971a93cb83c28f75bf3/tools/lib/makestuff.js#L8

When running any automated PR tests or npm run lint, an error is generated:

<dir>/highlight.js/tools/lib/makestuff.js
  8:19  error  Parsing error: Unexpected token import

This makes all pull requests fail testing.

Sample Code or Instructions to Reproduce

npm run lint or open a pull request

Error is in line to of this snippet:

async function clean(directory) {
  let del = await import('del');
  del.deleteSync([directory]);
  fs.mkdirSync(directory, { recursive: true });
}

Expected behavior All tests should pass

Additional context

There is an issue in the eslint repo with the response:

When using the default parser and sourceType: "module", the word import becomes a keyword token that can only be used in import declarations.

https://github.com/eslint/eslint/issues/11189#issuecomment-446586797

joshgoebel commented 8 months ago

If you know how to fix this a PR would be welcome. I haven't had a chance to look yet.