use import instead of require

This commit is contained in:
Labhansh Agrawal 2022-02-07 12:41:56 +05:30
parent cee275f61b
commit 2a4771fad5
3 changed files with 3 additions and 9 deletions

View file

@ -8,6 +8,7 @@ import {IPty, IWindowsPtyForkOptions, spawn as npSpawn} from 'node-pty';
import {cliScriptPath} from './config/paths';
import {dirname} from 'path';
import shellEnv from 'shell-env';
import osLocale from 'os-locale';
const createNodePtyError = () =>
new Error(
@ -106,8 +107,6 @@ export default class Session extends EventEmitter {
}
init({uid, rows, cols: columns, cwd, shell: _shell, shellArgs: _shellArgs}: SessionOptions) {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const osLocale = require('os-locale') as typeof import('os-locale');
const cleanEnv =
process.env['APPIMAGE'] && process.env['APPDIR'] ? shellEnv.sync(_shell || defaultShell) : process.env;
const baseEnv = Object.assign(