Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/fisker/editor-info
- Owner: fisker
- License: mit
- Created: 2021-05-22T09:00:10.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-03-31T02:12:18.000Z (7 months ago)
- Last Synced: 2024-03-31T03:22:03.701Z (7 months ago)
- Language: JavaScript
- Homepage:
- Size: 166 KB
- Stars: 6
- Watchers: 3
- Forks: 1
- Open Issues: 37
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
- awesome-eslint - editor-info - Detect whether one is within an editor/IDE and which type, allowing one to tweak ESLint configuration accordingly. (Tools / Testing Tools)
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).