Skip to content

Conversation

jamiebuilds
Copy link
Contributor

Fixes #2

@AprilArcus
Copy link

Tested, LGTM

@alanorozco
Copy link

Would really appreciate it if this fix was released :)

@jamiebuilds
Copy link
Contributor Author

Sorry I'm not able to merge on this repo anymore

@treshugart
Copy link

For those needing a workaround without resorting to a local patch, you can attempt a try/catch:


import traverse from 'eslint-traverse';
import os from 'node:os';

// ...

try {
  traverse(context, program, ({ node }) => {
    // You should also guard here.
    if (!node) {
      return;
    }
  });
} catch (e) {
  const stack = e.stack.split(os.EOL).map(s => s.trim());
  const eslintTraverseBug = stack[1];
  if (
    !eslintTraverseBug.includes(
      'eslint-traverse/index.js:24:55'
    )
  ) {
    throw e;
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Chokes on [, foo] = arr destructuring pattern

4 participants