Skip to content

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

@krassowski

Description

@krassowski

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
import {
  JupyterFrontEnd,
  JupyterFrontEndPlugin
} from '@jupyterlab/application';
import { ICompletionProviderManager } from '@jupyterlab/completer';
import { INotebookTracker } from '@jupyterlab/notebook';
const extension: JupyterFrontEndPlugin<void> = {
  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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions