Skip to content

Commit 228df57

Browse files
authored
Enforce type imports (#82)
1 parent 9224ef4 commit 228df57

File tree

6 files changed

+28
-20
lines changed

6 files changed

+28
-20
lines changed

package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,13 @@
159159
"@typescript-eslint"
160160
],
161161
"rules": {
162+
"@typescript-eslint/consistent-type-imports": [
163+
"error",
164+
{
165+
"prefer": "type-imports",
166+
"fixStyle": "separate-type-imports"
167+
}
168+
],
162169
"@typescript-eslint/naming-convention": [
163170
"error",
164171
{

src/client.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
import { PageConfig, URLExt } from '@jupyterlab/coreutils';
2-
import { ServerConnection, Terminal } from '@jupyterlab/services';
3-
import {
2+
import type { Terminal } from '@jupyterlab/services';
3+
import { ServerConnection } from '@jupyterlab/services';
4+
import type {
45
IExternalCommand,
56
IShellManager,
67
IStdinReply,
7-
IStdinRequest,
8-
ShellManager
8+
IStdinRequest
99
} from '@jupyterlite/cockle';
10-
import { JSONPrimitive } from '@lumino/coreutils';
11-
import { ISignal, Signal } from '@lumino/signaling';
10+
import { ShellManager } from '@jupyterlite/cockle';
11+
import type { JSONPrimitive } from '@lumino/coreutils';
12+
import type { ISignal } from '@lumino/signaling';
13+
import { Signal } from '@lumino/signaling';
1214

13-
import {
14-
Server as WebSocketServer,
15-
Client as WebSocketClient
16-
} from 'mock-socket';
15+
import type { Client as WebSocketClient } from 'mock-socket';
16+
import { Server as WebSocketServer } from 'mock-socket';
1717

1818
import { Shell } from './shell';
19-
import { ILiteTerminalAPIClient } from './tokens';
19+
import type { ILiteTerminalAPIClient } from './tokens';
2020

2121
export class LiteTerminalAPIClient implements ILiteTerminalAPIClient {
2222
constructor(options: { serverSettings?: ServerConnection.ISettings } = {}) {

src/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
// Copyright (c) Jupyter Development Team.
22
// Distributed under the terms of the Modified BSD License.
33

4-
import {
4+
import type {
55
JupyterFrontEnd,
66
JupyterFrontEndPlugin
77
} from '@jupyterlab/application';
88
import { IThemeManager } from '@jupyterlab/apputils';
9+
import type { ServiceManagerPlugin, Terminal } from '@jupyterlab/services';
910
import {
1011
IServerSettings,
1112
ITerminalManager,
1213
ServerConnection,
13-
ServiceManagerPlugin,
14-
Terminal,
1514
TerminalManager
1615
} from '@jupyterlab/services';
1716
import { IServiceWorkerManager } from '@jupyterlite/apputils';

src/shell.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import { BaseShell, IShell } from '@jupyterlite/cockle';
1+
import type { IShell } from '@jupyterlite/cockle';
2+
import { BaseShell } from '@jupyterlite/cockle';
23

3-
import { Client as WebSocketClient } from 'mock-socket';
4+
import type { Client as WebSocketClient } from 'mock-socket';
45

56
/**
67
* Shell class that uses web worker that plugs into a DriveFS via the service worker.

src/tokens.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { Terminal } from '@jupyterlab/services';
2-
import {
1+
import type { Terminal } from '@jupyterlab/services';
2+
import type {
33
IExternalCommand,
44
IStdinReply,
55
IStdinRequest
66
} from '@jupyterlite/cockle';
77
import { Token } from '@lumino/coreutils';
8-
import { ISignal } from '@lumino/signaling';
8+
import type { ISignal } from '@lumino/signaling';
99

1010
export const ILiteTerminalAPIClient = new Token<ILiteTerminalAPIClient>(
1111
'@jupyterlite/terminal:client'

src/worker.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { expose } from 'comlink';
22

3-
import { BaseShellWorker, IDriveFSOptions } from '@jupyterlite/cockle';
3+
import type { IDriveFSOptions } from '@jupyterlite/cockle';
4+
import { BaseShellWorker } from '@jupyterlite/cockle';
45
import { DriveFS } from '@jupyterlite/services';
56

67
/**

0 commit comments

Comments
 (0)