File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -425,7 +425,16 @@ TypeScriptはインポートしたものが型だけの場合に、出力から
425425
426426インポートだけではなく、\ ``export type { A, B } from "./modules"; ``\ といった、インポートして即エクスポートする文においては、\ ``export ``\ にも利用できます。
427427
428- 現在リリースされているtypescript-eslintにおいても、\ ``import type ``\ を使う方が推奨値としてデフォルト設定されています\ [# ]_\ 。
428+ 現在リリースされているtypescript-eslintの4.0以降においても、\ ``import type ``\ を使うことを強制するルールが追加されました\ [# ]_\ 。TypeScript 3.7以前ではすべてがエラーになってしまうため、デフォルトでは有効化されていません。
429+
430+ .. code-block :: json
431+ :caption: eslintrc.json
432+
433+ {
434+ "rules" : {
435+ "@typescript-eslint/consistent-type-imports" : " error"
436+ }
437+ }
429438
430439 .. [# ] 他に迷惑な有名なライブラリとしては、Pythonのthisがあります。\ ``import this ``\ をするとPythonの設計思想を表す詩が表示されます。
431440 .. [# ] https://github.com/typescript-eslint/typescript-eslint/blob/v4.1.1/packages/eslint-plugin/docs/rules/consistent-type-imports.md
You can’t perform that action at this time.
0 commit comments