Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fujiharuka/eslint-plugin-lcom
ESLint plugin to keep your JavaScript classes high cohesive by using LCOM (Lack of Cohesion of Methods) metric.
https://github.com/fujiharuka/eslint-plugin-lcom
cohesion eslint lcom
Last synced: 5 days ago
JSON representation
ESLint plugin to keep your JavaScript classes high cohesive by using LCOM (Lack of Cohesion of Methods) metric.
- Host: GitHub
- URL: https://github.com/fujiharuka/eslint-plugin-lcom
- Owner: FujiHaruka
- License: mit
- Created: 2020-09-10T11:52:01.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2020-09-12T13:13:31.000Z (about 4 years ago)
- Last Synced: 2024-10-06T13:36:49.114Z (about 1 month ago)
- Topics: cohesion, eslint, lcom
- Language: JavaScript
- Homepage:
- Size: 91.8 KB
- Stars: 8
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# eslint-plugin-lcom
![build status](https://github.com/fujiharuka/eslint-plugin-lcom/workflows/test/badge.svg)
![npm version](https://img.shields.io/npm/v/eslint-plugin-lcom.svg)ESLint plugin to keep your JavaScript classes high cohesive by using LCOM (Lack of Cohesion of Methods) metric.
## Installation
You'll first need to install [ESLint](http://eslint.org):
```
$ npm i eslint --save-dev
```Next, install `eslint-plugin-lcom`:
```
$ npm install eslint-plugin-lcom --save-dev
```## Usage
Add `lcom` to the plugins section of your `.eslintrc` configuration file. Then configure the rules you want to use under the rules section.
```json
{
"plugins": [
"lcom"
],
"rules": {
"lcom/lcom4": "warn"
}
}
```## Supported Rules
We currently support the only one rule of [`lcom4`](./docs/rules/lcom4.md). It ensures a value of so called [LCOM4](https://objectscriptquality.com/docs/metrics/lack-cohesion-methods-lcom4) to be less than 2 in a class.