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
- Host: GitHub
- URL: https://github.com/deecewan/eslint-plugin-only-var
- Owner: deecewan
- License: mit
- Created: 2017-03-09T03:06:42.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-12T01:34:21.000Z (about 9 years ago)
- Last Synced: 2025-06-28T06:01:57.276Z (12 months ago)
- Language: JavaScript
- Size: 18.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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"] }]
}
}
```