Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 27 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 8 years ago)
- Default Branch: master
- Last Pushed: 2016-10-07T13:13:19.000Z (about 8 years ago)
- Last Synced: 2024-10-12T20:54:17.800Z (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
[![NPM version](https://img.shields.io/npm/v/is-eslint-severity.svg)](https://www.npmjs.com/package/is-eslint-severity)
[![Build Status](https://travis-ci.org/shinnn/is-eslint-severity.svg?branch=master)](https://travis-ci.org/shinnn/is-eslint-severity)
[![Coverage Status](https://img.shields.io/coveralls/shinnn/is-eslint-severity.svg)](https://coveralls.io/r/shinnn/is-eslint-severity)
[![dependency Status](https://david-dm.org/shinnn/is-eslint-severity.svg)](https://david-dm.org/shinnn/is-eslint-severity)
[![devDependency Status](https://david-dm.org/shinnn/is-eslint-severity/dev-status.svg)](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).