{"id":13067,"date":"2021-01-24T17:33:29","date_gmt":"2021-01-24T08:33:29","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=13067"},"modified":"2023-05-27T20:54:56","modified_gmt":"2023-05-27T11:54:56","slug":"%e3%80%90javascript%e3%80%91%e3%80%8ceslint%e3%80%8d%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=13067","title":{"rendered":"\u3010JavaScript\u3011\u300cESLint\u300d\u3001\u30d7\u30e9\u30b0\u30a4\u30f3\u3001config\u306e\u7a2e\u985e\u306a\u3069"},"content":{"rendered":"<h2>ESLint\u3068\u306f\uff1f<\/h2>\n<p>JavaScript\u306e\u305f\u3081\u306e\u9759\u7684\u691c\u8a3c\u30c4\u30fc\u30eb\u3002\u30b3\u30fc\u30c9\u5b9f\u884c\u524d\u306b\u30d0\u30b0\u3092\u898b\u3064\u3051\u305f\u308a\u3001\u30ab\u30c3\u30b3\u3084\u30b9\u30bf\u30a4\u30eb\u3068\u7d71\u4e00\u3057\u305f\u308a\u3059\u308b\u305f\u3081\u306b\u4f7f\u3046\u3002Node.js8.10.0\u4ee5\u964d\u3092\u5229\u7528\u3057\u3066\u5b9f\u884c\u3067\u304d\u308b\u3002<\/p>\n<h2>\u7279\u5fb4<\/h2>\n<h3>\u5168\u3066\u306e\u691c\u8a3c\u30eb\u30fc\u30eb\u3092\u81ea\u7531\u306bon\/off\u3067\u304d\u308b\u3002<\/h3>\n<h3>\u81ea\u5206\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u5408\u308f\u305b\u3066\u30ab\u30b9\u30bf\u30e0\u30eb\u30fc\u30eb\u3092\u4f5c\u308c\u308b\u3002<\/h3>\n<h3>\u8c4a\u5bcc\u306a\u30d3\u30eb\u30c9\u30a4\u30f3\u30eb\u30fc\u30eb\u306b\u52a0\u3048\u3066\u3001\u591a\u304f\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u304c\u3042\u308b\u3002<\/h3>\n<h3>ES6\u4ee5\u964d\u3092\u6a19\u6e96\u3067\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u308b\u3002<\/h3>\n<h3>JSX\u8a18\u6cd5\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u308b\u3002<\/h3>\n<h3>Babel\u3068\u9023\u643a\u3059\u308b\u3053\u3068\u3067\u65b0\u3057\u3044\u69cb\u6587\u306b\u5bfe\u5fdc\u3067\u304d\u308b\u3002<\/h3>\n<h2>\u30b9\u30bf\u30a4\u30eb\u30ac\u30a4\u30c9<\/h2>\n<h3>Google JavaScript Style Guide<\/h3>\n<p>Google\u306b\u3088\u308b\u4ee3\u8868\u7684\u306a\u30b9\u30bf\u30a4\u30eb\u30ac\u30a4\u30c9\u3001Closure Linter\u3068\u3044\u3046Google\u88fd\u306elinter\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u3067\u7d71\u4e00\u304c\u3057\u3084\u3059\u304f\u306a\u308b\u3002<\/p>\n<h3>jQuery JavaScript Style Guide<\/h3>\n<p>jQuery\u306b\u3088\u308b\u30b9\u30bf\u30a4\u30eb\u30ac\u30a4\u30c9<\/p>\n<h3>Airbnb JavaScript Style Guide<\/h3>\n<p>\u6c11\u6cca\u30b5\u30fc\u30d3\u30b9\u304c\u6709\u540d\u306aAirbnb\u306e\u30b9\u30bf\u30a4\u30eb\u30ac\u30a4\u30c9\u3067\u3059\u3002GitHub\u4e0a\u3067\u6700\u3082\u4eba\u6c17\u306e\u3042\u308a\u307e\u3059\u3002ESlint\u3067\u306f\u7b2c\u4e00\u5019\u88dc\u306b\u6319\u304c\u308b\u307b\u3069\u3067\u3059\u3002<\/p>\n<h3>Node.js Style Guide<\/h3>\n<p>GitHub\u4e0a\u3067\u6700\u3082\u4eba\u6c17\u306e\u3042\u308b\u30b9\u30bf\u30a4\u30eb\u30ac\u30a4\u30c9<\/p>\n<h2>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n<pre class=\"lang:default decode:true\">npm install -g eslint<\/pre>\n<h2>\u8a2d\u5b9a<\/h2>\n<p>.eslintrc.json\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<table>\n<tbody>\n<tr>\n<th>\u30eb\u30fc\u30eb<\/th>\n<th>\u8aac\u660e<\/th>\n<\/tr>\n<tr>\n<td>extends<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>plugins<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>parserOptions<\/td>\n<td>ES6\u4ee5\u964d\u306e\u69cb\u6587\u3092\u6709\u52b9\u306b\u3067\u304d\u308b\u3002(\u30c7\u30d5\u30a9\u30eb\u30c8\u306fES5)<\/td>\n<\/tr>\n<tr>\n<td>env<\/td>\n<td>\u9759\u7684\u691c\u8a3c\u306e\u524d\u63d0\u6761\u4ef6\u3092\u8a2d\u5b9a\u3067\u304d\u308b\u3002\uff08\u4f8b\u3048\u3070\u3001\u30d6\u30e9\u30a6\u30b6\u3067\u5b9f\u884c\u3059\u308b\u30b3\u30fc\u30c9\u304b\u3069\u3046\u304b\u306a\u3069\uff09<\/td>\n<\/tr>\n<tr>\n<td>globals<\/td>\n<td>\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\u3092\u8ffd\u52a0\u5b9a\u7fa9\u3067\u304d\u308b\u3002<\/td>\n<\/tr>\n<tr>\n<td>rules<\/td>\n<td>\u30eb\u30fc\u30eb\u3092\u8ffd\u52a0\u3067\u304d\u308b\u3002<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h2>\u5b9f\u884c<\/h2>\n<p>node_modules\u5185\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u7121\u8996\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">eslint &lt;\u5bfe\u8c61\u30d5\u30a1\u30a4\u30eb&gt;<\/pre>\n<h2>\u30d7\u30e9\u30b0\u30a4\u30f3<\/h2>\n<p>ESlint\u306b\u306f\u5927\u304d\u304f3\u7a2e\u985e\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u3042\u308a\u307e\u3059\u3002Plugin\u3068Config\u306f\u4f3c\u3066\u3044\u308b\u304c\u3001Plugin\u306f\u30eb\u30fc\u30eb\u3001Config\u306f\u30eb\u30fc\u30eb\u3092\u4e00\u307e\u3068\u3081\u306b\u3057\u305f\u3082\u306e\u3068\u3044\u3046\u9055\u3044\u304c\u3042\u308b\u3002<\/p>\n<h3>Parser<\/h3>\n<p>\u958b\u767a\u8a00\u8a9e\u306e\u69cb\u6587\u3092\u89e3\u6790<\/p>\n<h4>@typescript-eslint\/parser<\/h4>\n<p>TypeScript\u3092\u89e3\u6790\u3002ESlint\u306bTypeScript\u3092\u7406\u89e3\u3055\u305b\u308b\u305f\u3081\u306b\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<h3>Plugin<\/h3>\n<p>Eslint\u306b\u30eb\u30fc\u30eb\u3092\u8ffd\u52a0<\/p>\n<h4>eslint-plugin-react<\/h4>\n<p>React\u306e\u30eb\u30fc\u30eb<\/p>\n<h4>@typescript-eslint\/eslint-plugin<\/h4>\n<p>TypeScript\u306e\u30eb\u30fc\u30eb<\/p>\n<h4>eslint-plugin-import<\/h4>\n<p>ES Modules\u306e\u30eb\u30fc\u30eb<\/p>\n<h4>eslint-plugin-jsx-a11y<\/h4>\n<p>JSX\u306e\u30eb\u30fc\u30eb<\/p>\n<h4>eslint-plugin-react-hooks<\/h4>\n<p>React Hooks\u306e\u30eb\u30fc\u30eb<\/p>\n<h2>Config<\/h2>\n<p>\u8907\u6570\u306e\u30eb\u30fc\u30eb\u3092\u307e\u3068\u3081\u3066\u9069\u7528<\/p>\n<h3>eslint-config-airbnb<\/h3>\n<p>Airbnb\u30b9\u30bf\u30a4\u30eb\u3092\u30eb\u30fc\u30eb\u3068\u3057\u3066\u307e\u3068\u3081\u305f\u3082\u306e<\/p>\n","protected":false},"excerpt":{"rendered":"ESLint\u3068\u306f\uff1f JavaScript\u306e\u305f\u3081\u306e\u9759\u7684\u691c\u8a3c\u30c4\u30fc\u30eb\u3002\u30b3\u30fc\u30c9\u5b9f\u884c\u524d\u306b\u30d0\u30b0\u3092\u898b\u3064\u3051\u305f\u308a\u3001\u30ab\u30c3\u30b3\u3084\u30b9\u30bf\u30a4\u30eb\u3068\u7d71\u4e00\u3057\u305f\u308a\u3059\u308b\u305f\u3081\u306b\u4f7f\u3046\u3002Node.js8.10.0\u4ee5\u964d\u3092\u5229\u7528\u3057\u3066\u5b9f\u884c\u3067\u304d\u308b\u3002 \u7279\u5fb4 \u5168\u3066\u306e\u691c\u8a3c\u30eb\u30fc\u30eb\u3092\u81ea [&hellip;]","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[16],"tags":[],"_links":{"self":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/13067"}],"collection":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=13067"}],"version-history":[{"count":7,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/13067\/revisions"}],"predecessor-version":[{"id":20279,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/13067\/revisions\/20279"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=13067"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=13067"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=13067"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}