Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Linter: enforce "import type" when applicable#18129

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
martinRenou wants to merge1 commit intojupyterlab:main
base:main
Choose a base branch
Loading
frommartinRenou:enforce_import_type

Conversation

@martinRenou
Copy link
Member

@martinRenoumartinRenou commentedNov 20, 2025
edited by jasongrout
Loading

References

Similar tojupyterlite/jupyterlite#1786

Description

To regenerate this PR, or I think to update any other PR to not conflict with this, apply this patch:

diff --git a/.eslintrc.js b/.eslintrc.jsindex ef3ed4b4ed..730f38dd30 100644--- a/.eslintrc.js+++ b/.eslintrc.js@@ -86,6 +86,13 @@ module.exports = {     '@typescript-eslint/triple-slash-reference': 'warn',     '@typescript-eslint/no-inferrable-types': 'off',     '@typescript-eslint/switch-exhaustiveness-check': 'error',+    '@typescript-eslint/consistent-type-imports': [+      'error',+      {+        prefer: 'type-imports',+        fixStyle: 'separate-type-imports'+      }+    ],     camelcase: [       'error',       {diff --git a/packages/codemirror/src/language.ts b/packages/codemirror/src/language.tsindex b5ac741707..1da94b9ba8 100644--- a/packages/codemirror/src/language.ts+++ b/packages/codemirror/src/language.ts@@ -1,6 +1,7 @@ // Copyright (c) Jupyter Development Team. // Distributed under the terms of the Modified BSD License.+import type * as SQLModule from '@codemirror/lang-sql'; import {   LanguageDescription,   LanguageSupport,@@ -286,7 +287,7 @@ export namespace EditorLanguageRegistry {    * @returns Language object    */   async function sql(-    dialectName: keyof typeof import('@codemirror/lang-sql')+    dialectName: keyof typeof SQLModule   ): Promise<LanguageSupport> {     const m = await import('@codemirror/lang-sql');     return m.sql({ dialect: (m as any)[dialectName] });

You can apply the patch by copying it to your clipboard, then doing

cat | git apply

then pasting the contents of the clipboard. If you are on a mac, you should instead be able to dopbpaste | git apply, or a similar command on linux likewl-paste | git apply.

Then runjlpm run eslint, then commit twice. In the first commit attempt, the precommit hook will run prettier to fix up some files, then commit for real the second time.

jlpm run eslintgit commit -am "Update eslint config to enforce type imports"git commit -am "Update eslint config to enforce type imports"

bollwyvl reacted with hooray emoji
@jupyterlab-probot
Copy link

Thanks for making a pull request to jupyterlab!
To try out this branch onbinder, follow this link:Binder

@jasongrout
Copy link
Contributor

I pasted my update instructions in the original description to make it easier to find, especially since github is now hiding the relevant comment.

@jasongrout
Copy link
Contributor

My thought on merging this: let's see what we can do to get the merge queue down in the next week or so by merging PRs, then merge this. That cuts down on the number of PRs we'd need to update and makes it easier to backport any PRs to 4.5, then we can easily update this PR and merge.

krassowski reacted with thumbs up emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

@martinRenoumartinRenou

Labels

documentationmaintenancepkg:applicationpkg:apputilspkg:attachmentspkg:audiopkg:cell-toolbarpkg:cellspkg:celltagspkg:codeeditorpkg:codemirrorpkg:completerpkg:consolepkg:coreutilspkg:csvviewerpkg:debuggerpkg:docmanagerpkg:docregistrypkg:documentsearchpkg:extensionmanagerpkg:filebrowserpkg:fileeditorpkg:helppkg:htmlviewerpkg:hubpkg:imageviewerpkg:inspectorpkg:javascriptpkg:jsonpkg:launcherpkg:logconsolepkg:lsppkg:mainmenupkg:markdownviewerpkg:mathjaxpkg:mermaidpkg:metadataformpkg:notebookpkg:observablespkg:outputareapkg:pdfpkg:pluginmanagerpkg:property-inspectorpkg:rendermimepkg:runningpkg:servicespkg:settingeditorpkg:settingregistrypkg:shortcutspkg:statedbpkg:statusbarpkg:terminalpkg:themespkg:tocpkg:tooltippkg:translationpkg:ui-componentspkg:vegapkg:videopkg:workspacestag:Examplestag:Testing

Projects

None yet

Milestone

4.6.0

Development

Successfully merging this pull request may close these issues.

3 participants

@martinRenou@jtpio@jasongrout

[8]ページ先頭

©2009-2025 Movatter.jp