Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shinnn/unconfigured-eslint-rules
Detect unconfigured ESLint rules
https://github.com/shinnn/unconfigured-eslint-rules
Last synced: 26 days ago
JSON representation
Detect unconfigured ESLint rules
- Host: GitHub
- URL: https://github.com/shinnn/unconfigured-eslint-rules
- Owner: shinnn
- License: isc
- Created: 2015-09-08T06:05:51.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2019-06-29T17:06:59.000Z (over 5 years ago)
- Last Synced: 2024-09-19T05:20:29.279Z (about 2 months ago)
- Language: JavaScript
- Size: 66.4 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# unconfigured-eslint-rules
[![npm version](https://img.shields.io/npm/v/unconfigured-eslint-rules.svg)](https://www.npmjs.com/package/unconfigured-eslint-rules)
[![GitHub Actions](https://action-badges.now.sh/shinnn/unconfigured-eslint-rules)](https://wdp9fww0r9.execute-api.us-west-2.amazonaws.com/production/results/shinnn/unconfigured-eslint-rules)
[![codecov](https://codecov.io/gh/shinnn/unconfigured-eslint-rules/branch/master/graph/badge.svg)](https://codecov.io/gh/shinnn/unconfigured-eslint-rules)Detect unconfigured [ESLint](https://eslint.org/) rules
```javascript
/*
./eslintrc.js:module.exports = {
rules: {
'no-alert': 'error',
'no-array-constructor': 'warn',
'no-bitwise': 'off',
'linebreak-style': ['error', "unix"],
}
}
*/const unconfiguredESLintRules = require('unconfigured-eslint-rules');
const unconfigured = unconfiguredESLintRules(); //=> ['no-caller', 'no-catch-shadow', 'no-class-assign', ...]unconfigured.includes('no-alert'); //=> false
unconfigured.includes('no-array-constructor'); //=> false
unconfigured.includes('no-bitwise'); //=> false
unconfigured.includes('linebreak-style'); //=> false
```This module is designed to help developing [sharable configs](https://eslint.org/docs/developer-guide/shareable-configs). When a developer [updates](https://docs.npmjs.com/cli/update) ESLint and the latest version introduces new rules, `unconfiguredESLintRules().length` increases and they'll notice those new rules. [`@shinnn/eslint-config`](https://github.com/shinnn/eslint-config) provides a [real world example](https://github.com/shinnn/eslint-config/blob/596a56f11034ac344120a655c368d9fd4ac09305/test/test.js#L72-L157) of this approach.
## Installation
[Use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/about-npm/).
```
npm install unconfigured-eslint-rules
```## API
```javascript
const unconfiguredEslintRules = require('unconfigured-eslint-rules');
```### unconfiguredEslintRules([*options*])
*options*: `Object` (ESLint [`CLIEngine`](https://eslint.org/docs/developer-guide/nodejs-api#cliengine) constructor options)
Return: `string[]`The API is the same as [configured-eslint-rules'](https://github.com/shinnn/configured-eslint-rules#api), but returns the inverse – an `Array` of [rule](http://eslint.org/docs/rules/) names with no [rule configurations](http://eslint.org/docs/user-guide/configuring#configuring-rules).
```javascript
/*
./my-dir/.eslintrc.json:{
"rules": {
"semi": ["error", "always"]
}
}
*/unconfiguredEslintRules().includes('semi'); //=> true
process.chdir('my-dir');
unconfiguredEslintRules().includes('semi'); //=> false
```The argument will be directly passed to the underlying `CLIEngine` constructor and affects the result.
```javascript
/*
./eslintrc.yml:rules:
eqeqeq: warn
*/unconfiguredEslintRules({}).includes('curly'); //=> false
unconfiguredEslintRules({rules: {curly: 'warn'}}).includes('curly'); //=> true
```## License
[ISC License](./LICENSE) © 2018 - 2019 Watanabe Shinnosuke