8000 GitHub - fisker/editor-info: Get details about the current editor.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fisker/editor-info

Repository files navigation

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.

About

Get details about the current editor.

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  
0