{"action":"created","issue":{"url":"https://api.github.com/repos/liqiUser/blog/issues/4","repository_url":"https://api.github.com/repos/liqiUser/blog","labels_url":"https://api.github.com/repos/liqiUser/blog/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/liqiUser/blog/issues/4/comments","events_url":"https://api.github.com/repos/liqiUser/blog/issues/4/events","html_url":"https://github.com/liqiUser/blog/issues/4","id":372224433,"node_id":"MDU6SXNzdWUzNzIyMjQ0MzM=","number":4,"title":"问题总结","user":{"login":"liqiUser","id":24649014,"node_id":"MDQ6VXNlcjI0NjQ5MDE0","avatar_url":"https://avatars0.githubusercontent.com/u/24649014?v=4","gravatar_id":"","url":"https://api.github.com/users/liqiUser","html_url":"https://github.com/liqiUser","followers_url":"https://api.github.com/users/liqiUser/followers","following_url":"https://api.github.com/users/liqiUser/following{/other_user}","gists_url":"https://api.github.com/users/liqiUser/gists{/gist_id}","starred_url":"https://api.github.com/users/liqiUser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liqiUser/subscriptions","organizations_url":"https://api.github.com/users/liqiUser/orgs","repos_url":"https://api.github.com/users/liqiUser/repos","events_url":"https://api.github.com/users/liqiUser/events{/privacy}","received_events_url":"https://api.github.com/users/liqiUser/received_events","type":"User","site_admin":false},"labels":[{"id":1119570882,"node_id":"MDU6TGFiZWwxMTE5NTcwODgy","url":"https://api.github.com/repos/liqiUser/blog/labels/%E9%97%AE%E9%A2%98","name":"问题","color":"5b69bf","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-10-20T15:48:47Z","updated_at":"2018-12-03T18:00:33Z","closed_at":null,"author_association":"OWNER","body":"这个 Issues 用来放置工作和学习中遇到的一些问题以及解决办法。\r\n问题本身也许不难，但有时为了解决它也许要花不少时间。\r\n这些解决的问题也是一种经验的积累。"},"comment":{"url":"https://api.github.com/repos/liqiUser/blog/issues/comments/443806531","html_url":"https://github.com/liqiUser/blog/issues/4#issuecomment-443806531","issue_url":"https://api.github.com/repos/liqiUser/blog/issues/4","id":443806531,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MzgwNjUzMQ==","user":{"login":"liqiUser","id":24649014,"node_id":"MDQ6VXNlcjI0NjQ5MDE0","avatar_url":"https://avatars0.githubusercontent.com/u/24649014?v=4","gravatar_id":"","url":"https://api.github.com/users/liqiUser","html_url":"https://github.com/liqiUser","followers_url":"https://api.github.com/users/liqiUser/followers","following_url":"https://api.github.com/users/liqiUser/following{/other_user}","gists_url":"https://api.github.com/users/liqiUser/gists{/gist_id}","starred_url":"https://api.github.com/users/liqiUser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liqiUser/subscriptions","organizations_url":"https://api.github.com/users/liqiUser/orgs","repos_url":"https://api.github.com/users/liqiUser/repos","events_url":"https://api.github.com/users/liqiUser/events{/privacy}","received_events_url":"https://api.github.com/users/liqiUser/received_events","type":"User","site_admin":false},"created_at":"2018-12-03T18:00:33Z","updated_at":"2018-12-03T18:00:33Z","author_association":"OWNER","body":"**在 eslint 使用 airbnb 规范的项目中使用 webpack 的 alias 导致出错**\r\n```\r\nUnable to resolve path to module 'xxx'   -   import/no-unresolved\r\nMissing file extension for \"xxx\"   -  import/extensions\r\n```\r\n原因：在 airbnb  规范中不允许使用这种方式 import 文件。\r\n解决：使用 `eslint-import-resolver-webpack` 解决问题\r\n - 在你的 `.eslintrc.js` 文件下加入以下内容解决报错问题：\r\n```js\r\n...\r\n\"settings\": {\r\n    \"import/resolver\": {\r\n        \"webpack\": {\r\n            \"config\": \"./config/defaultConfig.js\"  // your webpack path\r\n        }\r\n    }\r\n},\r\n...\r\n```\r\n - webpack 的 alias 在 css 中一样可以使用，需要在前面加上 ~ 号：\r\n```less\r\n@imagesUrl: '~@static/images';\r\n...\r\n.Angular {\r\n    background-image: url('@{imagesUrl}/Angular.png');\r\n}\r\n```\r\n**需要注意的是在 js 中 alias 不要使用以 @ 开头，css 中不要使用以 $ 开头**\r\n@ 在 js 中 airbnb   会当做 package 包，$ 在 css 中不会被解析"}}
{"actor":{"display_login":"liqiUser"}}