https://github.com/shinnn/is-eslint-severity
Check if a given value is one of the ESLint severity level specifiers
https://github.com/shinnn/is-eslint-severity
Last synced: 18 days ago
JSON representation
Check if a given value is one of the ESLint severity level specifiers
- Host: GitHub
- URL: https://github.com/shinnn/is-eslint-severity
- Owner: shinnn
- License: mit
- Created: 2016-03-07T12:04:52.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-10-07T13:13:19.000Z (almost 9 years ago)
- Last Synced: 2025-06-08T22:13:54.629Z (about 1 month ago)
- Language: JavaScript
- Homepage: https://tonicdev.com/npm/is-eslint-severity
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# is-eslint-severity
[](https://www.npmjs.com/package/is-eslint-severity)
[](https://travis-ci.org/shinnn/is-eslint-severity)
[](https://coveralls.io/r/shinnn/is-eslint-severity)
[](https://david-dm.org/shinnn/is-eslint-severity)
[](https://david-dm.org/shinnn/is-eslint-severity#info=devDependencies)Check if a given value is one of the [ESLint](http://eslint.org/) [severity level](http://eslint.org/docs/user-guide/configuring#configuring-rules) specifiers
```javascript
const isEslintSeverity = require('is-eslint-severity');isEslintSeverity(0); //=> true
isEslintSeverity(1); //=> true
isEslintSeverity(2); //=> trueisEslintSeverity('off'); //=> true
isEslintSeverity('warn'); //=> true
isEslintSeverity('error'); //=> trueisEslintSeverity(3); //=> false
isEslintSeverity('info'); //=> false
```## Installation
[Use npm.](https://docs.npmjs.com/cli/install)
```
npm install is-eslint-severity
```## API
```javascript
const isEslintSeverity = require('is-eslint-severity');
```### isEslintSeverity(*value*)
*value*: `String` or `Number`
Return: `Boolean`It returns `true` if the given value can be used as an [ESLint](https://github.com/eslint/eslint) rule severity, otherwise returns `false`.
```javascript
isEslintSeverity(1.5); //=> false
isEslintSeverity([2]); //=> false
isEslintSeverity(new Buffer('off')); //=> false
isEslintSeverity(); //=> false
```## License
Copyright (c) 2016 [Shinnosuke Watanabe](https://github.com/shinnn)
Licensed under [the MIT License](./LICENSE).