Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Lint] Fix violations of no-var and ban-types #168

Merged
merged 2 commits into from
Jun 10, 2024

Conversation

dchege711
Copy link
Owner

Contributes to #162

Rationale from [1]:

ECMAScript 6 allows programmers to create variables with block scope instead of
function scope using the let and const keywords. Block scope is common in many other
programming languages and helps programmers avoid mistakes such as:

```ts
var count = people.length;
var enoughFood = count > sandwiches.length;

if (enoughFood) {
    var count = sandwiches.length; // accidentally overriding the count variable
    console.log("We have " + count + " sandwiches for everyone. Plenty for all!");
}

// our count variable is no longer accurate
console.log("We have " + count + " people and " + sandwiches.length + " sandwiches!");
```

[1]: https://eslint.org/docs/latest/rules/no-var
Rationale from [1]:

Don't use the upper-case primitive types, you should use the lower-case types for
consistency.

Don't use `Boolean` as a type. Use `boolean` instead.

Fixes 2 linter errors. 99 to go.

[1]: https://typescript-eslint.io/rules/ban-types/
Copy link

render bot commented Jun 10, 2024

@dchege711 dchege711 merged commit 648b56c into main Jun 10, 2024
4 checks passed
@dchege711 dchege711 deleted the user/dchege711/fixing-linter-errors-2-of-n branch June 10, 2024 05:48
dchege711 added a commit that referenced this pull request Jun 11, 2024
Ignore mechanical fixes like:

* #167 `prefer-const`
* #168 `no-var`, `ban-types`
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.

1 participant