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.

Forgetting "use strict" results in the entire file being underlined

See original GitHub issue

Overview

With the rule configuration strict: ['warn', 'global']

If you forget to include the 'use strict' directive at top of the file, it highlights the entire file, rather than just the first line.

image

Expected behavior would be to only show the warning on the first line.

What rule do you want to change?

strict

Does this change cause the rule to produce more or fewer warnings?

Yes

How will the change be implemented? (New option, new default behavior, etc.)?

new option

Please provide some example code that this change will affect:

With the rule configuration strict: ['warn', 'global']

let x = 1;
let y = 2;
let z = 3;

What does the rule currently do for this code?

The entire file is underlined. Making it difficult to see/count other issues.

What will the rule do after it’s changed?

It will only underline the first line.

Are you willing to submit a pull request to implement this change?

Yes.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
bmishcommented, Jul 9, 2021

I don’t think we need a new option to control where the violation is reported…

0reactions
nzakascommented, Jul 12, 2021

The rule doesn’t know if its configured as an error or a warning, and that’s by design, because we don’t want rules to behave differently depending on how they are configured.

Given that it seems there’s agreement that the current behavior is mostly correct, I don’t see us making a change here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

html - Centred, underlined headings where the underline is a ...
Another idea is to use table to center and then apply a gradient where you can easily adjust the size, position and color:....
Read more >
Errors and warnings - PLINK 1.9 - cog-genomics.org
When the FID or IID already contains an underscore, this may make it difficult to reconstruct them from the VCF file; you may...
Read more >
Content Configuration - Tailwind CSS
Configuring the content sources for your project. The content section of your tailwind.config.js file is where you configure the paths to all of...
Read more >
What Are Document & Contract Redlining? - Best Practices 2021
A redline is a part of the negotiation process during document and business contract management where contributors track changes ...
Read more >
FREE Online Grammar Check - Grammar Check
FREE Grammar Checker. Simply paste your writing & all spelling, punctuation, and grammar mistakes will be identified. Embarrassing grammar mistakes are a ...
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