Skip to content

Commit

Permalink
use import instead of require
Browse files Browse the repository at this point in the history
  • Loading branch information
LabhanshAgrawal committed Feb 7, 2022
1 parent cee275f commit 2a4771f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
4 changes: 1 addition & 3 deletions app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ remoteInitialize();
import {resolve} from 'path';

// Packages
import {app, BrowserWindow, Menu} from 'electron';
import {app, BrowserWindow, Menu, screen} from 'electron';
import {gitDescribe} from 'git-describe';
import isDev from 'electron-is-dev';
import * as config from './config';
Expand Down Expand Up @@ -98,8 +98,6 @@ app.on('ready', () =>
let [startX, startY] = winSet.position;

const [width, height] = options.size ? options.size : cfg.windowSize || winSet.size;
// eslint-disable-next-line @typescript-eslint/no-var-requires
const {screen} = require('electron');

const winPos = options.position;

Expand Down
3 changes: 1 addition & 2 deletions app/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down
5 changes: 1 addition & 4 deletions webpack.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// eslint-disable-next-line @typescript-eslint/no-var-requires
const Copy = require('copy-webpack-plugin');
import Copy from 'copy-webpack-plugin';
import path from 'path';
import TerserPlugin from 'terser-webpack-plugin';
import webpack from 'webpack';
Expand Down Expand Up @@ -29,7 +28,6 @@ const config: webpack.Configuration[] = [
]
},
plugins: [
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
new Copy({
patterns: [
{
Expand Down Expand Up @@ -99,7 +97,6 @@ const config: webpack.Configuration[] = [
NODE_ENV: JSON.stringify(nodeEnv)
}
}),
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
new Copy({
patterns: [
{
Expand Down

0 comments on commit 2a4771f

Please sign in to comment.