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.

Incompatibility with some coding styles

See original GitHub issue

Hello!

I’m a fan of putting a space after the opening and before the closing function parens (for multiple reasons), and it seems like this plugin is not compatible with that type of coding style because it’s using (too) specific sub-string to match when collecting the properties, ie var(--.

Perhaps something like this would make it more forgiving?

Declaration (node, {Declaration}) {
	// bail early
	if (node[processed]) return

	let matches = node.value.match(/var\(\s*[\w\d-]+\s*\)/g);

	if (!matches) return;

	let props = matches.map(v => v.match(/var\(\s*([\w\d-]+)\s*\)/)[1])

	// ...
}

Disclaimer: My regex-fu is questionable 😁

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
argyleinkcommented, Dec 10, 2021

released and fixed in 1.0.2 👍🏻 thanks for the help!

1reaction
kucrutcommented, Dec 10, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

What are some problems caused by programs that are correct ...
Inconsistent coding makes code harder to maintain. Inconsistent coding style makes merges worse because changes in whitespace (you use tabs, another person ...
Read more >
Coding conventions (code style)
Everyone has opinions about coding style. This document contains some high-level advice. ... Many other coding convention documents are available.
Read more >
Recommended C Style and Coding Standards
This document is an updated version of the Indian Hill C Style and Coding Standards paper, with modifications by the last three authors....
Read more >
Typescript incompatibility with the prop style #479 - GitHub
Describe the bug. The style prop causes a TypeScript error, presumably because React treats it as a regular element style attribute instead of...
Read more >
7 Common Cross Browser Compatibility Issues to Avoid
In this article, we will explore some of the most common reasons cross browser test cases can fail. Consider this a list of...
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