Skip to content

Conversation

@leotm
Copy link
Contributor

@leotm leotm commented Apr 13, 2020

Summary

Our custom global variable would be nicer declared as a const.

var doesn't seem to present any advantages here.

Functionality-wise the block scope remains the same as the global scope.

Semantic-wise it's clear it is global as @emin93 already moved it below imports.

Also ib4 wave of ESLint no-var adopters (e.g. gabts/eslint-config-react-native-typescript)

Further: https://eslint.org/docs/rules/no-var#when-not-to-use-it

Test Plan

What's required for testing (prerequisites)?

What are the steps to reproduce (after prerequisites)?

  • yarn lint

Compatibility

OS Implemented
iOS ✅❌
Android ✅❌

Our custom global variable would be nicer declared as a `const`.

`var` doesn't seem to present any advantages here.

Functionality-wise the block scope remains the same as the global scope.

Semantic-wise it's clear it is global as @emin93 already moved it below imports.

Also ib4 wave of ESLint `no-var` adopters (e.g. https://github.com/gabts/eslint-config-react-native-typescript).

Further, see: https://eslint.org/docs/rules/no-var#when-not-to-use-it
@leotm leotm requested review from emin93 and radko93 as code owners April 13, 2020 14:24
Copy link
Collaborator

@radko93 radko93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense, of course, thanks!

@radko93 radko93 merged commit 2c8213c into react-native-community:master Apr 13, 2020
@leotm leotm deleted the patch-2 branch April 13, 2020 20:53
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.

2 participants