Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fisker/editor-info

Get details about the current editor.
https://github.com/fisker/editor-info

Last synced: 3 months ago
JSON representation

Get details about the current editor.

Awesome Lists containing this project

README

        

# editor-info

> Get details about the current editor environment.

## Installation

```bash
yarn add editor-info
```

## Usage

```js
import editor from 'editor-info'

console.log(editor.isEditor)
// -> true
```

## Example

When you want disable some ESLint rules in your editor.

```js
// .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](https://github.com/watson/ci-info).