jupyterlab / jupyterlab/plugin-playground

Setup `@jupyter/eslint-plugin`: both for extension code and for LSP on binder

Open
#74 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
60
Forks
21
PR merge metrics
No merged PRs in 30d

Description

### Problem

Some requirements related to creating Jupyter extensions are not picked up by the TypeScript type checker.

On Binder we already have LSP integration setup:

Image

But it does not catch issues like incorrect plugin order:

Image

Code

```ts
import {
JupyterFrontEnd,
JupyterFrontEndPlugin
} from '@jupyterlab/application';
import { ICompletionProviderManager } from '@jupyterlab/completer';
import { INotebookTracker } from '@jupyterlab/notebook';
const extension: JupyterFrontEndPlugin = {
id: 'completer',
autoStart: true,
requires: [ICompletionProviderManager, INotebookTracker],
activate: async (
app: JupyterFrontEnd,
notebooks: INotebookTracker,
completionManager: ICompletionProviderManager
) => {
console.log('JupyterLab custom completer extension is activated!');
}
};

export default extension;
```

### Proposed Solution

https://github.com/jupyterlab/eslint-plugin allows to spot these and saves time when developing extensions.

We should:
- integrate it with the extension codebase
- make sure it works on Binder
- but reconfigure require the rules which require plugin descriptions and command schema to be "info" rather than "error" as when prototyping these do not matter that much. Or maybe we should even have a toggle to disable these altogether? This could be a follow-up task

### Additional context

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.