Skip to content

Commit 2a4771f

Browse files
use import instead of require
1 parent cee275f commit 2a4771f

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

app/index.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ remoteInitialize();
1717
import {resolve} from 'path';
1818

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

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

104102
const winPos = options.position;
105103

app/session.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {IPty, IWindowsPtyForkOptions, spawn as npSpawn} from 'node-pty';
88
import {cliScriptPath} from './config/paths';
99
import {dirname} from 'path';
1010
import shellEnv from 'shell-env';
11+
import osLocale from 'os-locale';
1112

1213
const createNodePtyError = () =>
1314
new Error(
@@ -106,8 +107,6 @@ export default class Session extends EventEmitter {
106107
}
107108

108109
init({uid, rows, cols: columns, cwd, shell: _shell, shellArgs: _shellArgs}: SessionOptions) {
109-
// eslint-disable-next-line @typescript-eslint/no-var-requires
110-
const osLocale = require('os-locale') as typeof import('os-locale');
111110
const cleanEnv =
112111
process.env['APPIMAGE'] && process.env['APPDIR'] ? shellEnv.sync(_shell || defaultShell) : process.env;
113112
const baseEnv = Object.assign(

webpack.config.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// eslint-disable-next-line @typescript-eslint/no-var-requires
2-
const Copy = require('copy-webpack-plugin');
1+
import Copy from 'copy-webpack-plugin';
32
import path from 'path';
43
import TerserPlugin from 'terser-webpack-plugin';
54
import webpack from 'webpack';
@@ -29,7 +28,6 @@ const config: webpack.Configuration[] = [
2928
]
3029
},
3130
plugins: [
32-
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
3331
new Copy({
3432
patterns: [
3533
{
@@ -99,7 +97,6 @@ const config: webpack.Configuration[] = [
9997
NODE_ENV: JSON.stringify(nodeEnv)
10098
}
10199
}),
102-
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
103100
new Copy({
104101
patterns: [
105102
{

0 commit comments

Comments
 (0)