Skip to content
This repository was archived by the owner on Sep 27, 2023. It is now read-only.

Improve imports#39

Merged
akiomik merged 5 commits intodevelopmentfrom
improve-import-paths
Aug 13, 2021
Merged

Improve imports#39
akiomik merged 5 commits intodevelopmentfrom
improve-import-paths

Conversation

@akiomik
Copy link
Copy Markdown
Contributor

@akiomik akiomik commented Aug 13, 2021

  • パスの修正漏れの対応 886fc2c
  • モジュール読み込みをファイルから見た相対パスからルートディレクトリからの絶対パスに修正
    7093df9 adcca64
  • モジュールのソートを有効化 0ffb25f 159b63a

@akiomik akiomik changed the title Improve import paths Improve imports Aug 13, 2021
@akiomik akiomik self-assigned this Aug 13, 2021
@akiomik akiomik requested a review from shoe116 August 13, 2021 08:17
Comment thread webpack.config.js
resolve: {
extensions: ['.ts']
extensions: ['.ts'],
plugins: [new TsconfigPathsPlugin()]
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tsconfig.jsonpaths をwebpackに反映

Comment thread tsconfig.json
Comment on lines +8 to +11
"baseUrl": ".",
"paths": {
"~/*": ["src/*"]
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typescriptのトランスパイル時に、 '~/version' のように ~/* にマッチするモジュールを ${baseUrl}/src/*に変換する設定

Comment thread .eslintrc.js
Comment on lines +24 to +27
plugins: ['@typescript-eslint', 'import'],
rules: {
"import/order": [2, { "alphabetize": { "order": "asc" } }]
},
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

importのソートに関する設定

Comment thread jest.config.js
Comment on lines +3 to +5
moduleNameMapper: {
'~/(.*)': '<rootDir>/src/$1'
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

テストフレームワークのjestのモジュール解決の設定。 '~/version' のように ~/(.*) にマッチするモジュールを '<rootDir>/src/$1 に置換する

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

なるほど

@akiomik akiomik merged commit 7d55a04 into development Aug 13, 2021
@akiomik akiomik deleted the improve-import-paths branch August 13, 2021 08:44
@akiomik akiomik mentioned this pull request Nov 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants