0.0.3 • Published 3 years ago

editor-info v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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.

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago

0.0.0

3 years ago