microsoft / microsoft/TypeScript

source.organizeImports organizes imports to a sort order that tslint complains about

オープン
#30,430 コメント 4 件 リアクション 7 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Experience Enhancement Suggestion
主要言語
Go
スター
111k
フォーク
14.4k
平均マージ
1日 19時間
マージ済み PR(30日)
117

説明

Issue Type: Bug

settings:
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.organizeImports": true
}
tslint.json:
{
"extends": "tslint-microsoft-contrib",
...

Code:

import * as cp from 'child_process';
import * as fse from 'fs-extra';
import { IActionContext, parseError } from 'vscode-azureextensionui';
import { ImageNode } from '../explorer/models/imageNode';
import { ext } from '../extensionVariables';
import { docker, DockerEngineType } from './utils/docker-endpoint';
import { ImageItem, quickPickImage } from './utils/quick-pick-image';
import os = require('os');
import vscode = require('vscode');

That gives this error:
image

Auto-fixing the lint issue reorders to this code:

import * as cp from 'child_process';
import * as fse from 'fs-extra';
import os = require('os');
import vscode = require('vscode');
import { IActionContext, parseError } from 'vscode-azureextensionui';
import { ImageNode } from '../explorer/models/imageNode';
import { ext } from '../extensionVariables';
import { docker, DockerEngineType } from './utils/docker-endpoint';
import { ImageItem, quickPickImage } from './utils/quick-pick-image';

Then pressing CTRL+S to save puts it back to the first form, which causes the lint error again.

VS Code version: Code - Insiders 1.33.0-insider (d77d8d561143cc021a82664efc056755c075d070, 2019-03-11T08:47:23.627Z)
OS version: Windows_NT x64 10.0.17763

System Info
Item Value
CPUs Intel(R) Xeon(R) W-2133 CPU @ 3.60GHz (12 x 3600)
GPU Status 2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: enabled
surface_synchronization: enabled_on
video_decode: enabled
webgl: enabled
webgl2: enabled
Memory (System) 31.73GB (16.54GB free)
Process Argv
Screen Reader no
VM 0%
Extensions (13)
Extension Author (truncated) Version
vscode-antlr4 mik 2.1.1
vscode-cosmosdb ms- 0.10.0
extension-manifest-editor ms- 0.1.5
azure-account ms- 0.8.0
csharp ms- 1.17.1
vscode-typescript-tslint-plugin ms- 1.0.0
azurerm-vscode-tools msa 0.5.0
vscode-docker Pet 0.5.2
vscode-sort-json ric 1.13.0
scope-info sie 0.2.0
tmcolor sle 0.0.1
sort-lines Tyr 1.8.0
win-ca uko 2.4.0

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

source.organizeImports コードアクションと、issue に示されている import の並べ替え動作から始め、それをエラーを報告する tslint の順序と比較します。指定された設定と import を使って保存サイクルを再現します。import の整理によって tslint 違反が直ちに再発しなくなれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
typescript
領域
tooling
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。