False positive in macrosRegex
See original GitHub issueWe recently released @formatjs/macro
and got this issue https://github.com/formatjs/react-intl/issues/1511 for a user. The macro we use is not compatible with babel-plugin-macros because we use that in TS transformer & eslint as well so we don’t wrap it, but it looks like babel-plugin-macros might be too aggressive and throw an error if it detects anything that looks like macrosRegex
. My suggestion: Can we turn this into a warning?
Issue Analytics
- State:
- Created 4 years ago
- Comments:18 (9 by maintainers)
Top Results From Across the Web
regex_macro false positive · Issue #2586 · rust-lang/rust-clippy ...
When defining a custom regex! macro to use the lazy_static pattern more easily, the regex_macro picks it up. This occurs with nom and...
Read more >handling false positives regex - Stack Overflow
I have a regex responsible for matching tracking numbers for USPS. There are 2 expressions grouped together as follows:
Read more >IT14093: FULL TEXT MACRO REGEX FILTERS INCORRECT ...
We would rather have a known false positive than a known false negative. As such, we will keep the dashes as they are....
Read more >A Type System for Regular Expressions - Amazon S3
routines are recognized by the Regex Checker and cause it to be more precise in its type analysis by avoiding false positives.
Read more >Suppression of false positive warnings - PVS-Studio
Suppressing false positives located within C/C++ macro statements (#define) and for other code fragments. It goes without saying that the ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Alright, to whom it may concerns.
We had to extend our Babel config to supply a custom
isMacrosName()
function. https://github.com/kentcdodds/babel-plugin-macros/blob/2cac571a5809c42671c2bcbd74921df65036369e/src/index.js#L5-L6babel.config.js:
@kentcdodds I couldn’t find any documentation for
isMacrosName()
, neither in user docs, nor author docs. https://github.com/kentcdodds/babel-plugin-macros/search?q=isMacrosName&unscoped_q=isMacrosNameI face the same warning from
@formatjs/macro
as described here https://github.com/formatjs/react-intl/issues/1511Here is the reuslt of
npm ls
:Error Log: