editor-info
v0.0.4
Published
Get details about the current editor.
Downloads
52
Readme
editor-info
Get details about the current editor environment.
Installation
yarn add editor-info
Usage
import editor from 'editor-info'
console.log(editor.isEditor)
// -> true
Example
When you want disable some ESLint rules in your editor.
// .eslintrc.js
const {isEditor} = require('editor-info')
module.exports = {
root: true,
extends: ['@fisker'],
rules: {
'no-console': isEditor ? 'off' : 'error',
},
}
Supported Editors
| Name | Constant | | :----------------- | :------------ | | Atom | editor.ATOM | | Visual Studio Code | editor.VSCODE |
This package is heavily inspired by ci-info.