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.

no-use-before-define

See original GitHub issue

Would it be possible to have some rule that StyleSheet.create-variables can be used before defined? If I understand correctly that is the best practice and that collides with no-use-before-define

Issue Analytics

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

github_iconTop GitHub Comments

38reactions
cwRichardKimcommented, Feb 17, 2018

https://stackoverflow.com/questions/42981070/eslint-no-use-before-define This is probably a better solution: "no-use-before-define": ["error", { "variables": false }]. Makes it target variables only

16reactions
Intellicodecommented, May 24, 2016

I understand now, personally I define my styles at the top, but I guess it makes sense to define them at the bottom since they are closer to where they are used (the render method). I can add a rule that creates an exception for style sheets.

Read more comments on GitHub >

github_iconTop Results From Across the Web

no-use-before-define - ESLint - Pluggable JavaScript Linter
This rule will warn when it encounters a reference to an identifier that has not yet been declared. Examples of incorrect code for...
Read more >
ESLint no-use-before-define - javascript
It looks like you might be interested in the variables option, for this rule. You can read about that option here.
Read more >
no-use-before-define - TypeScript ESLint
Disallow the use of variables before they are defined. Examples​. This rule extends the base eslint/no-use-before-define rule. It adds support for ...
Read more >
lint-trap/no-use-before-define.md at master
JavaScript linter module for Uber projects. Contribute to uber-archive/lint-trap development by creating an account on GitHub.
Read more >
Adam Wathan
It thinks "bar" is being used before it's defined but it's not, it's not actually *used* until foo() runs on line 12. Makes...
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