question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Doesn't Flag LookBehind Regexp on Firefox 77

See original GitHub issue

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:

env:
  browser: true
  es6: true
extends:
  - standard
  - plugin:compat/recommended
globals:
  Atomics: readonly
  SharedArrayBuffer: readonly
parser: babel-eslint
parserOptions:
  ecmaFeatures:
    jsx: true
    experimentalObjectRestSpread: true
  ecmaVersion: 2018
  sourceType: module
plugins:
  - react
  - unused-imports
  - compat
  - es
rules: {
  "react/jsx-uses-react" : "error", 
 # "max-len" : ['error',{ code: 120,ignorePattern: 'import.*| .*:.*' }], #these ignore import statements as well as the agent.js file example where we have a dictionary of constants that can be long.
  "react/jsx-uses-vars": "error",
  "compat/compat": "error",
  "no-console": 1,
  "unused-imports/no-unused-imports": 2,
  "unused-imports/no-unused-vars": 1,
  "lines-between-class-members": 2,
  "padding-line-between-statements": ['error',{ blankLine: "always", prev: "function", next: "function" },{ blankLine: "always", prev: "multiline-const", next: "multiline-const" }],
  "import/newline-after-import": ["error"]
}

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:3
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
curiousdanniicommented, Jan 19, 2022

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?

1reaction
ljharbcommented, Aug 25, 2020

That’s what babel and babel-eslint is for.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Javascript regex (negative) lookbehind not working in firefox
New RegExp engine in SpiderMonkey, adding support for the dotAll flag, Unicode escape sequences, lookbehind references, and named captures.
Read more >
Lookbehind in JS regular expressions | Can I use... Support ...
Lookbehind in JS regular expressions ... zero-width assertions in JavaScript regular expressions can be used to ensure a pattern is ... Firefox for...
Read more >
1634135 - Enable new regexp engine - Bugzilla@Mozilla
The fix is to pop the saved value before subtracting the length. With this fix, we pass all the test262 tests for look-behind...
Read more >
Mimicking Lookbehind in JavaScript - Flagrant Badassery
Unlike lookaheads, JavaScript doesn't support regex lookbehind syntax. ... for RegExp objects, make sure to read about it at the Mozilla ...
Read more >
eslint-plugin-compat - Bountysource
Doesn't Flag LookBehind Regexp on Firefox 77 $ 0. Created 2 years ago in amilajack/eslint-plugin-compat with 5 comments. https://kangax.github.io ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found