LoginSignup
1
0

More than 5 years have passed since last update.

webpackのresolve.aliasを設定するとimport/extensionsのeslintのエラーが出る

Last updated at Posted at 2019-03-16

importの際、あちこちで../../../という相対パスだらけになっていたので、webpackのresolveに設定を書いた。


  resolve: {
    alias: {
      '@config': path.join(process.cwd(), './src/config'),
    },
  },

すると、import/extensionsのeslintのルールで怒られる
調べた結果、eslintの設定はairbnbの設定をextendsしていたのだが、このairbnbの設定が古いことで怒られているぽかった。

また、eslint-plugin-importも最新にしないとこのeslintのエラー出ちゃう問題は解決しないぽかった。
https://github.com/airbnb/javascript/issues/1092

{
  "extends": "airbnb",

package.jsonを見るとeslint-config-airbnbeslint-plugin-importのverが固定で入っていたので最新のものにあげたらエラーは消えた。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0