Get details about the current editor environment.
yarn add editor-info
import editor from 'editor-info'
console.log(editor.isEditor)
// -> true
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',
},
}
Name | Constant |
---|---|
Atom | editor.ATOM |
Visual Studio Code | editor.VSCODE |
This package is heavily inspired by ci-info.