Open TheSecMaven opened 4 years ago
we did find - plugin:es/no-2018 has a rule for catching it, but giiven this is the plugin that is supposed to catch browser stuff, we are wondering what we did wrong
We currently don't lint syntatic ES features. We only lint ES/WebAPIs at the moment.
anything out there that does? or a roadmap to include support for that? seems like a pretty big gap.
That's what babel and babel-eslint is for.
How does babel and babel-eslint solve this issue? Does babel compile look-behind regexp?
@mkkeffeler I went ahead and created a small eslint plugin no-lookahead-lookbehind-regexp to do this as I didnt want to rely on the whole es/no-2018 as it's a bit of an overkill imo. I published it as a beta tag so feel free to test it and drop some feedback. I just noticed that safari actually compile lookahead and lookbehind and it's just the negative lookahead and lookbehind that break, but I will fix that asap.
Look behinds are unsupported in Safari but this plugin didn't show the problem. I don't use Babel, and @babel/eslint-parser doesn't appear to do browser checking like this plugin does.
It's fine for this project to set its scope firmly (though I wish that was explained a little more clearly in the readme). Anyone know of any other packages that can test ES syntax features?
https://kangax.github.io/compat-table/es2016plus/ shows Firefox 77 isn't compatible with the regexp lookbehind feature, firefox 78 release notes show it added it in that release (same table shows and confirms the same)
npx browserslist shows firefox 77 is in the defaults, which we use. why wasn't this caught? we had a look behind that passed the linter, and caused our app to fail on Firefox 77.
eslintrc config: