Skip to content

Commit ca51387

Browse files
committed
use ICodeMirror, more type imports, order plugin for fixer
1 parent 86b357b commit ca51387

File tree

94 files changed

+699
-549
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+699
-549
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
"vscode-css-languageserver-bin": "^1.4.0",
2626
"vscode-html-languageserver-bin": "^1.4.0",
2727
"vscode-json-languageserver-bin": "^1.0.1",
28-
"yaml-language-server": "^0.12.0",
29-
"vscode-json-languageservice": "^3.9.1 <3.10.0"
28+
"vscode-json-languageservice": "^3.9.1 <3.10.0",
29+
"yaml-language-server": "^0.12.0"
3030
},
3131
"husky": {
3232
"hooks": {}

packages/.eslintrc.js

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ module.exports = {
1010
root: true,
1111
extends: [
1212
'eslint:recommended',
13+
'plugin:import/errors',
14+
'plugin:import/warnings',
15+
'plugin:import/typescript',
1316
'plugin:@typescript-eslint/eslint-recommended',
1417
'plugin:@typescript-eslint/recommended',
1518
'prettier/@typescript-eslint',
@@ -55,12 +58,32 @@ module.exports = {
5558
'no-undef': 'warn',
5659
'no-useless-escape': 'off',
5760
'prefer-const': 'off',
58-
// deviations from jupyterlab, should not be changed
59-
// a pitfall of enums is that they do not work correctly
60-
// when circular dependencies are present
61-
// (see https://stackoverflow.com/a/59665223/)
62-
'import/no-cycle': 'error',
61+
// the default, but for reference...
62+
'import/order': [
63+
'warn',
64+
{
65+
groups: [
66+
'builtin',
67+
'external',
68+
'parent',
69+
'sibling',
70+
'index',
71+
'object',
72+
'unknown'
73+
],
74+
pathGroups: [
75+
{ pattern: 'react/**', group: 'builtin', order: 'after' },
76+
{ pattern: 'codemirror/**', group: 'external', order: 'before' },
77+
{ pattern: '@lumino/**', group: 'external', order: 'before' },
78+
{ pattern: '@jupyterlab/**', group: 'external', order: 'after' }
79+
],
80+
'newlines-between': 'always',
81+
alphabetize: { order: 'asc' }
82+
}
83+
],
6384
// deviations from jupyterlab, should probably be fixed
85+
'import/no-cycle': 'off', // somehow we lapsed here... ~200 cycles now
86+
'import/export': 'off', // we do class/interface + NS pun exports _all over_
6487
'@typescript-eslint/triple-slash-reference': 'off',
6588
'jest/no-test-callback': 'off',
6689
'jest/valid-expect': 'off',

packages/_example-extractor/src/api.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1+
import { IExtractedCode } from '@krassowski/jupyterlab-lsp';
12
import { expect } from 'chai';
23

34
import { extractor } from '.';
45

5-
import { IExtractedCode } from '@krassowski/jupyterlab-lsp';
6-
76
const EXAMPLE = `%%foo
87
bar
98
`;

packages/_example-extractor/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import {
22
JupyterFrontEnd,
33
JupyterFrontEndPlugin
44
} from '@jupyterlab/application';
5-
65
import {
76
ILSPCodeExtractorsManager,
87
RegExpForeignCodeExtractor

packages/code-jumpers/src/history.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import { IGlobalPosition } from './positions';
21
import { IModelDB, IObservableUndoableList } from '@jupyterlab/observables';
32
import { JSONValue } from '@lumino/coreutils';
43

4+
import { IGlobalPosition } from './positions';
5+
56
const DB_ENTRY = 'jumpy_history';
67

78
export class JumpHistory {

packages/code-jumpers/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import { FileEditorJumper } from './jumpers/fileeditor';
12
import { CodeJumper } from './jumpers/jumper';
23
import { NotebookJumper } from './jumpers/notebook';
3-
import { FileEditorJumper } from './jumpers/fileeditor';
44

55
export { CodeJumper, NotebookJumper, FileEditorJumper };

packages/code-jumpers/src/jumpers/fileeditor.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
import { CodeEditor } from '@jupyterlab/codeeditor';
2+
import { IDocumentManager } from '@jupyterlab/docmanager';
3+
import { IDocumentWidget } from '@jupyterlab/docregistry';
14
import { FileEditor } from '@jupyterlab/fileeditor';
5+
6+
import { JumpHistory } from '../history';
27
import { IGlobalPosition, ILocalPosition } from '../positions';
8+
39
import { CodeJumper, jumpers } from './jumper';
4-
import { JumpHistory } from '../history';
5-
import { IDocumentManager } from '@jupyterlab/docmanager';
6-
import { IDocumentWidget } from '@jupyterlab/docregistry';
7-
import { CodeEditor } from '@jupyterlab/codeeditor';
810

911
export class FileEditorJumper extends CodeJumper {
1012
editor: FileEditor;

packages/code-jumpers/src/jumpers/jumper.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1+
import { Dialog, showDialog } from '@jupyterlab/apputils';
12
import { CodeEditor } from '@jupyterlab/codeeditor';
2-
3-
import { IGlobalPosition, ILocalPosition } from '../positions';
43
import { IDocumentManager } from '@jupyterlab/docmanager';
54
import { IDocumentWidget } from '@jupyterlab/docregistry';
6-
import { JumpHistory } from '../history';
75
import { FileEditor } from '@jupyterlab/fileeditor';
6+
7+
import { JumpHistory } from '../history';
8+
import { IGlobalPosition, ILocalPosition } from '../positions';
9+
810
import IEditor = CodeEditor.IEditor;
9-
import { Dialog, showDialog } from '@jupyterlab/apputils';
1011

1112
const movement_keys = [
1213
'ArrowRight',

packages/code-jumpers/src/jumpers/notebook.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import { Notebook, NotebookPanel } from '@jupyterlab/notebook';
1+
import { CodeEditor } from '@jupyterlab/codeeditor';
22
import { IDocumentManager } from '@jupyterlab/docmanager';
3+
import { Notebook, NotebookPanel } from '@jupyterlab/notebook';
34

4-
import { CodeJumper, jumpers } from './jumper';
5-
import { IGlobalPosition, ILocalPosition } from '../positions';
6-
import { _ensureFocus } from '../notebook_private';
75
import { JumpHistory } from '../history';
8-
import { CodeEditor } from '@jupyterlab/codeeditor';
6+
import { _ensureFocus } from '../notebook_private';
7+
import { IGlobalPosition, ILocalPosition } from '../positions';
8+
9+
import { CodeJumper, jumpers } from './jumper';
910

1011
export class NotebookJumper extends CodeJumper {
1112
notebook: Notebook;

packages/completion-theme/src/about.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
import { LabIcon } from '@jupyterlab/ui-components';
12
import React, { ReactElement } from 'react';
3+
24
import {
5+
COMPLETER_THEME_PREFIX,
36
ICompletionTheme,
4-
ILicenseInfo,
5-
COMPLETER_THEME_PREFIX
7+
ILicenseInfo
68
} from './types';
7-
import { LabIcon } from '@jupyterlab/ui-components';
89

910
function render_licence(licence: ILicenseInfo): ReactElement {
1011
return (

0 commit comments

Comments
 (0)