eslint: Browser version of 5.15.x does not work in IE 11

Tell us about your environment

  • ESLint Version: 5.15.x
  • Node Version: 11.11.0
  • npm Version: 6.9.0

What did you do?

Built ESLint using

npm run webpack

and ran it in IE 11 (more precisely, in a web worker and in conjunction with the Monaco editor but that should not matter). The source code couldn’t be parsed because it contains a lot of ES2015+ syntax like const and let since the recent change to Webpack. The Browserify version in 5.14.x works in IE 11.

You can get a step further by changing the Webpack config to also transpile files from node_modules (including .mjs files apparently) like shown below. This makes sure to transpile to ES5 but I got stuck at this stage because IE still throws the error Incorrect syntax in regular expression. Since I saw nothing obvious in the source code I gave up at this point.

rules: [
    {
        test: /\.m?js$/u,
        loader: "babel-loader",
        options: {
            presets: ["@babel/preset-env"]
        }
    }
]

So the question boils down to: What browsers do you intend to support with the browser variant of ESLint?

Are you willing to submit a pull request to fix this bug? Not at the moment, sorry.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 17 (7 by maintainers)

Commits related to this issue

Most upvoted comments

Hm, it can in principle (Babel Regex). But I think there would be limitations for usages like

return new RegExp(LINEBREAK_MATCHER.source, "gu");
// or
new RegExp(somePatternVariable, someFlagVariable)

because it can’t really manipulate the content of those variables, right?