An open API service indexing awesome lists of open source software.

https://github.com/deecewan/eslint-plugin-only-var

Enforce `var` usage
https://github.com/deecewan/eslint-plugin-only-var

Last synced: about 1 month ago
JSON representation

Enforce `var` usage

Awesome Lists containing this project

README

          

# eslint-plugin-only-var

> Enforce `var` usage.

## Why

While we're in the process of upgrading the code base to newer versions of JS, we currently cannot use `const` or `let`. Sometimes we get confused and do it anyways. This will stop that.

## Usage

```
yarn add -D eslint-plugin-only-var
```

```js
// .eslintrc
{
// ...
"plugins": [
"only-var"
],
"rules": {
"only-var/only-var": "error"
}
}
```

If you want to ignore certain files, you can specify their extensions like so:

```js
// .eslintrc
{
// ...
"plugins": [
"only-var"
],
"rules": {
"only-var/only-var": ["error", { "ignore": [".jsx"] }]
}
}
```