Linter ignores multiline /* eslint-env */
directives
#14652
Labels
accepted
There is consensus among the team that this change meets the criteria for inclusion
archived due to age
This issue has been archived; please open a new issue for any further discussion
bug
ESLint is working incorrectly
core
Relates to ESLint's core APIs and features
repro:yes
Issues with a reproducible example
Tell us about your environment
What parser (default,
@babel/eslint-parser
,@typescript-eslint/parser
, etc.) are you using?default
Please show your full configuration:
Configuration
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
What did you expect to happen?
no
no-undef
errors, becausebrowser
environment enableswindow
globalWhat actually happened? Please copy-paste the actual, raw output from ESLint.
Steps to reproduce this issue:
Online Demo
Are you willing to submit a pull request to fix this bug?
Yes, if it is a bug.
The issue is: linter ignores multiline
/* eslint-env ... */
comments. A single-line comment works well, as in this demo.I couldn't find a test case or a discussion that would confirm that this was intentional. It looks like a common bug with
.
in a regular expression that doesn't have thes
flag.Also,
noInlineConfig: true
option does report multilineeslint-env
as a directive:The text was updated successfully, but these errors were encountered: