is-eslint-severity
v1.0.1
Published
Check if a given value is one of the ESLint severity level specifiers
Downloads
4
Maintainers
Readme
is-eslint-severity
Check if a given value is one of the ESLint severity level specifiers
const isEslintSeverity = require('is-eslint-severity');
isEslintSeverity(0); //=> true
isEslintSeverity(1); //=> true
isEslintSeverity(2); //=> true
isEslintSeverity('off'); //=> true
isEslintSeverity('warn'); //=> true
isEslintSeverity('error'); //=> true
isEslintSeverity(3); //=> false
isEslintSeverity('info'); //=> false
Installation
npm install is-eslint-severity
API
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 rule severity, otherwise returns false
.
isEslintSeverity(1.5); //=> false
isEslintSeverity([2]); //=> false
isEslintSeverity(new Buffer('off')); //=> false
isEslintSeverity(); //=> false
License
Copyright (c) 2016 Shinnosuke Watanabe
Licensed under the MIT License.