Home

Awesome

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

NameConstant
Atomeditor.ATOM
Visual Studio Codeeditor.VSCODE

This package is heavily inspired by ci-info.