https://github.com/dielduarte/eslint-plugin-better-js-code
This is just an experimental eslint plugin, to test my knowledge on AST, parsers, and eslint plugins in general
https://github.com/dielduarte/eslint-plugin-better-js-code
Last synced: 12 months ago
JSON representation
This is just an experimental eslint plugin, to test my knowledge on AST, parsers, and eslint plugins in general
- Host: GitHub
- URL: https://github.com/dielduarte/eslint-plugin-better-js-code
- Owner: dielduarte
- Created: 2021-07-06T01:42:46.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-12-30T22:33:11.000Z (about 4 years ago)
- Last Synced: 2025-01-07T15:42:14.346Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 37.1 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# eslint-plugin-better-js-code (only for study purpose)
This is just an experimental eslint plugin, to test my knowledge on AST, parsers, and eslint plugins in general.
it handles a few interesting challenges you can face when creating a plugin:
- scope navigation (up/down the tree)
- type comparison in JS
- strict vs non strict mode
Check the tests file to understand the scenarios when the plugin would report an error.
If you are considering using a plugin like that, my advice would be to take a look at a type system.
## Installation
You'll first need to install [ESLint](https://eslint.org/):
```sh
npm i eslint --save-dev
```
Next, clone this repository and create a local link
```sh
yarn link
```
and the following command in the project you would like to test it:
```sh
yarn link eslint-plugin-better-js-code
```
## Usage
Add `better-js-code` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:
```json
{
"plugins": [
"better-js-code"
]
}
```
Then configure the rules you want to use under the rules section.
```json
{
"rules": {
"better-js-code/no-diff-variable-types": 2
}
}
```
## Supported Rules
* Fill in provided rules here