Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shinnn/configured-eslint-rules
Detect configured ESLint rules
https://github.com/shinnn/configured-eslint-rules
Last synced: 26 days ago
JSON representation
Detect configured ESLint rules
- Host: GitHub
- URL: https://github.com/shinnn/configured-eslint-rules
- Owner: shinnn
- License: isc
- Created: 2015-09-08T04:39:44.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2019-06-29T15:40:45.000Z (over 5 years ago)
- Last Synced: 2024-10-02T22:45:30.420Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 112 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# configured-eslint-rules
[![npm version](https://img.shields.io/npm/v/configured-eslint-rules.svg)](https://www.npmjs.com/package/configured-eslint-rules)
[![GitHub Actions](https://action-badges.now.sh/shinnn/configured-eslint-rules)](https://wdp9fww0r9.execute-api.us-west-2.amazonaws.com/production/results/shinnn/configured-eslint-rules)
[![codecov](https://codecov.io/gh/shinnn/configured-eslint-rules/branch/master/graph/badge.svg)](https://codecov.io/gh/shinnn/configured-eslint-rules)Detect configured [ESLint](https://eslint.org/) rules
```javascript
/*
./eslintrc.json:{
"rules": {
"no-alert": 2,
"no-array-constructor": 1,
"no-bitwise": 0,
"linebreak-style": [2, "unix"],
}
}
*/const configuredESLintRules = require('configured-eslint-rules');
const configured = configuredESLintRules();
//=> ['no-alert', 'no-array-constructor', 'no-bitwise', 'linebreak-style']
```## Installation
[Use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/about-npm/).
```
npm install configured-eslint-rules
```## API
```javascript
const configuredEslintRules = require('configured-eslint-rules');
```### configuredEslintRules([*options*])
*options*: `Object | CLIEngine`
Return: `string[]`It returns an `Array` of the [ESLint rule](https://eslint.org/docs/rules/) names that have [rule configurations](https://eslint.org/docs/user-guide/configuring#configuring-rules) on a current working directory.
The optional parameter accepts either a plain `Object` to set [`CLIEngine`](https://eslint.org/docs/developer-guide/nodejs-api#cliengine) options or an already instantiated `CLIEngine`, and affects the result.
```javascript
/*
./eslintrc.yml:rules:
eqeqeq: 1
*/configuredEslintRules(); //=> ['eqeqeq']
configuredEslintRules({rules: {curly: 0}}); //=> ['eqeqeq', 'curly']
```## License
[ISC License](./LICENSE) © 2018 - 2019 Watanabe Shinnosuke