Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matijs/eslint-plugin-this
ESLint plugin to disallow the use of 'this'
https://github.com/matijs/eslint-plugin-this
Last synced: 11 days ago
JSON representation
ESLint plugin to disallow the use of 'this'
- Host: GitHub
- URL: https://github.com/matijs/eslint-plugin-this
- Owner: matijs
- License: mit
- Created: 2016-08-17T19:59:20.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-03-09T11:25:55.000Z (over 1 year ago)
- Last Synced: 2024-10-14T22:11:07.643Z (25 days ago)
- Language: JavaScript
- Homepage:
- Size: 56.6 KB
- Stars: 16
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-eslint - this - Write pure functions, don't allow `this`. (Plugins / Practices and Specific ES Features)
README
# eslint-plugin-this
[![Build Status](https://travis-ci.org/matijs/eslint-plugin-this.svg?branch=master)](https://travis-ci.org/matijs/eslint-plugin-this)
[![Version on npm](https://img.shields.io/npm/v/eslint-plugin-this.svg)](https://www.npmjs.com/package/eslint-plugin-this)
[![Known Vulnerabilities](https://snyk.io/test/github/matijs/eslint-plugin-this/badge.svg)](https://snyk.io/test/github/matijs/eslint-plugin-this)do not allow `this`
## Installation
You'll first need to install [ESLint](http://eslint.org):
```
$ npm install eslint --save-dev
```Next, install `eslint-plugin-this`:
```
$ npm install eslint-plugin-this --save-dev
```**Note:** If you installed ESLint globally (using the `-g` or `--global` flag) then you must also install `eslint-plugin-this` globally.
## Usage
Add `this` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:
```json
{
"plugins": [
"this"
]
}
```Then configure the rules you want to use under the rules section.
```json
{
"rules": {
"this/no-this": 2
}
}
```## Supported Rules
* no-this
## Thanks
Thanks to [Brian Leroux](https://twitter.com/brianleroux/) for [asking](https://twitter.com/brianleroux/status/765951425922805761) if this existed and Björn Tegelund for basically spelling out how to [create an ESLint plugin](https://medium.com/tumblbug-engineering/creating-an-eslint-plugin-87f1cb42767f#.ijk5j86go)