
{"id":5753,"date":"2023-09-22T21:00:02","date_gmt":"2023-09-22T12:00:02","guid":{"rendered":"https:\/\/techmania.jp\/blog\/?p=5753"},"modified":"2023-09-26T11:33:03","modified_gmt":"2023-09-26T02:33:03","slug":"programming-tool0001","status":"publish","type":"post","link":"https:\/\/techmania.jp\/blog\/programming-tool0001\/","title":{"rendered":"\u3010ESlint\u5165\u9580\u3011Prettier\u3068\u306e\u4f75\u7528\u3067\u30b3\u30fc\u30c9\u54c1\u8cea\u3092\u5411\u4e0a\u3055\u305b\u308b"},"content":{"rendered":"<p>ESLint\u3068Prettier\u306e\u7d44\u307f\u5408\u308f\u305b\u306f\u30b3\u30fc\u30c9\u306e\u54c1\u8cea\u5411\u4e0a\u3001\u8aad\u307f\u3084\u3059\u3055\u306e\u5411\u4e0a\u3001\u30c1\u30fc\u30e0\u958b\u767a\u306b\u304a\u3051\u308b\u4e00\u8cab\u6027\u306e\u78ba\u4fdd\u306a\u3069\u591a\u304f\u306e\u30e1\u30ea\u30c3\u30c8\u3092\u63d0\u4f9b\u3057\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n<p>\u672c\u8a18\u4e8b\u3067\u306f\u5b9f\u969b\u306b\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u5c0e\u5165\u3057\u305f\u5185\u5bb9\u306b\u57fa\u3065\u304d ESlint\u3068Prettier\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n<h2 id=\"outline__1\" class=\"wp-block-heading\">ESlint\u3068\u306f?<\/h2>\n\n\n<p>ESlint(\u30a4\u30fc\u30a8\u30b9\u30ea\u30f3\u30c8)\u3068\u306f\u3001JavaScript\u306e\u30b3\u30fc\u30c9\u304c\u898f\u7d04\u306b\u6cbf\u3063\u3066\u66f8\u304b\u308c\u3066\u3044\u308b\u304b\u3001\u6307\u5b9a\u3057\u305f\u30eb\u30fc\u30eb\u306b\u9055\u53cd\u3057\u3066\u3044\u306a\u3044\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3092\u3057\u3066\u6307\u6458\u3084\u4fee\u6b63\u3092\u3057\u3066\u304f\u308c\u308b\u9759\u7684\u89e3\u6790\u30c4\u30fc\u30eb\u3067\u3059\u3002<\/p>\n<p>\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067TypeScript\u3001Vue.js\u3001React\u306a\u3069\u306e\u69d8\u3005\u306a\u7a2e\u985e\u306e\u30b3\u30fc\u30c9\u3092\u89e3\u6790\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n<h2 id=\"outline__2\" class=\"wp-block-heading\">Prettier\u3068\u306f\uff1f<\/h2>\n\n\n<p>Prettier(\u30d7\u30ea\u30c6\u30a3\u30a2\u30fc)\u306f\u30b3\u30fc\u30c9\u306e\u81ea\u52d5\u6574\u5f62\u3092\u884c\u3046\u30c4\u30fc\u30eb\u3067\u30b3\u30fc\u30c9\u306e\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3092\u7d71\u4e00\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001\u30c1\u30fc\u30e0\u958b\u767a\u306b\u304a\u3051\u308b\u30b3\u30fc\u30c9\u306e\u54c1\u8cea\u3001\u8aad\u307f\u3084\u3059\u3055\u3001\u4e00\u8cab\u6027\u3092\u5411\u4e0a\u3055\u305b\u307e\u3059\u3002<\/p>\n\n\n<h2 id=\"outline__3\" class=\"wp-block-heading\">ESlint\u3068Prettier\u306e\u9055\u3044<\/h2>\n\n\n<p>\u3069\u3061\u3089\u3082\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u88dc\u52a9\u3059\u308b\u30c4\u30fc\u30eb\u3067\u3059\u304c\u3001ESlint\u306f\u30b3\u30fc\u30c9\u306e\u54c1\u8cea\u3084\u30b9\u30bf\u30a4\u30eb\u3092\u30c1\u30a7\u30c3\u30af\u3057\u3066\u6f5c\u5728\u7684\u306a\u30a8\u30e9\u30fc\u3092\u898b\u3064\u3051\u8b66\u544a\u3084\u30a8\u30e9\u30fc\u3092\u51fa\u3057\u3066\u7c21\u6613\u306a\u3082\u306e\u306f\u4fee\u6b63\u3092\u884c\u306a\u3063\u3066\u304f\u308c\u308b\u30c4\u30fc\u30eb\u3067\u3042\u308b\u306e\u306b\u5bfe\u3057\u3001Prettier\u306f\u30b3\u30fc\u30c9\u306e\u30a4\u30f3\u30c7\u30f3\u30c8\u3084\u30af\u30a9\u30fc\u30c8\u306e\u4f7f\u3044\u65b9\u306a\u3069\u306e\u6574\u5f62\u3092\u62c5\u5f53\u3057\u3066\u4e00\u8cab\u6027\u306e\u3042\u308b\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306b\u4fdd\u3063\u3066\u304f\u308c\u308b\u30c4\u30fc\u30eb\u3067\u3059\u3002<\/p>\n\n\n<h2 id=\"outline__4\" class=\"wp-block-heading\">\u5c0e\u5165\u65b9\u6cd5<\/h2>\n\n\n<p>\u30b3\u30fc\u30c9\u30a8\u30c7\u30a3\u30bf\u306fVSCode\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002\u4eca\u56de\u306e\u5c0e\u5165\u3067\u306fJavaScript\u306e\u4ed6\u306bTypeScript\u3068vue.js\u3092\u89e3\u6790\u3067\u304d\u308b\u3088\u3046\u8a2d\u5b9a\u3092\u3057\u307e\u3057\u305f\u3002\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306bpackage.json\u304c\u7121\u3044\u5834\u5408\u306f\u5148\u306b\u4f5c\u6210\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n\n\n<h2 id=\"outline__5\" class=\"wp-block-heading\">ESlint\u306e\u5c0e\u5165<\/h2>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:default decode:true \">npm init @eslint\/config<\/pre><\/div>\n\n\n<p>\u3053\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u3067\u5bfe\u8a71\u578b\u306e\u30d7\u30ed\u30f3\u30d7\u30c8\u304c\u8868\u793a\u3055\u308c\u5fc5\u8981\u306a\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3084\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e\u4f5c\u6210\u3092\u884c\u306a\u3063\u3066\u304f\u308c\u308b\u4fbf\u5229\u306a\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002<\/p>\n<p>\u3067\u3059\u304c\u3001\u3053\u3061\u3089\u3067\u306f\u5185\u5bb9\u306e\u8aac\u660e\u3082\u542b\u3081\u3066\u624b\u52d5\u3067\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u306b\u3064\u3044\u3066\u7d39\u4ecb\u3057\u307e\u3059\uff01<\/p>\n\n\n<h3 id=\"outline__5_1\" class=\"wp-block-heading\">\u5fc5\u8981\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:default decode:true \">npm install --save-dev\u3000\u3000eslint\u3000\nnpm install --save-dev @typescript-eslint\/eslint-pulugin @typescript-eslint\/parser\nnpm install --save-dev eslint-plugin-vue<\/pre><\/div>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>\u30d1\u30c3\u30b1\u30fc\u30b8<\/strong><\/td><td><strong>\u5f79\u5272<\/strong><\/td><\/tr><tr><td>eslint<\/td><td>ESlint\u672c\u4f53<\/td><\/tr><tr><td>@typescript-eslint\/eslint-pulugin<br>@typescript-eslint\/parser<\/td><td>ESlint\u3067TypeScript\u3092\u6b63\u3057\u3044\u30eb\u30fc\u30eb\u3067\u89e3\u6790\u3067\u304d\u308b\u69d8\u306b\u3059\u308b<\/td><\/tr><tr><td>eslint-plugin-vue<\/td><td>vue.js\u3092\u89e3\u6790\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n<p>\u3053\u306e\u30b3\u30de\u30f3\u30c9\u3067package.json\u306e\u201ddevDependencies\u201d\u306b\u8ffd\u52a0\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n<h3 id=\"outline__5_2\" class=\"wp-block-heading\">\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e\u4f5c\u6210\uff08.eslintrc\uff09<\/h3>\n\n\n<p>\u30eb\u30fc\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b`.eslintrc`\u3092\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u308b\u30d5\u30a1\u30a4\u30eb\u5f62\u5f0f\u3067\u4f5c\u6210\u3057\u8a2d\u5b9a\u3092\u8ffd\u52a0\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/eslint.org\/docs\/latest\/use\/configure\/configuration-files#configuration-file-formats\" target=\"_blank\" rel=\"noopener\"><strong>\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u300cESlint\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u5f62\u5f0f\u300d<\/strong><\/a><\/p>\n<p>\u4eca\u56de\u306f`.eslintrc.js`\u3067\u4f5c\u6210\u3057\u3066\u307e\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:default decode:true \">module.exports = {\n    env: {\n        browser: true,\n        es2021: true,\n    },\n\n    extends: [\n        \"eslint:recommended\",\n        \"plugin:@typescript-eslint\/recommended\",\n        \"plugin:vue\/vue3-strongly-recommended\"\n    ],\n\n    ignorePatterns: \".eslintrc.js\",\n\n    parserOptions: {\n        ecmaVersion: \"latest\",\n        parser: \"@typescript-eslint\/parser\",\n        extraFileExtensions: [\".vue\"],\n        sourceType: \"module\",\n        project: \".\/tsconfig.json\",\n    },\n\n    plugins: [\n\t\t\t\t\"@typescript-eslint\",\n\t\t\t\t\"vue\"\n\t\t],\n\n    rules: {\n    },\n};<\/pre><\/div>\n\n\n\n<h4 id=\"outline__5_2_1\" class=\"wp-block-heading\">env<\/h4>\n\n\n<p>\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\u3092\u8aad\u307f\u8fbc\u3080\u9805\u76ee\u3067\u3059\u3002window\u3084document\u306a\u3069\u306e\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\u3092\u4f7f\u304a\u3046\u3068\u3059\u308b\u3068\u3001\u300c\u5b9a\u7fa9\u3055\u308c\u3066\u306a\u3044\u306e\u3067\u4f7f\u3048\u307e\u305b\u3093\u300d\u3068\u30a8\u30e9\u30fc\u304c\u51fa\u3066\u3057\u307e\u3046\u306e\u3092\u9632\u3050\u8a2d\u5b9a\u3067\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:default decode:true \">env: {\n        browser: true,\n    },<\/pre><\/div>\n\n\n<p>\u3053\u306e\u3088\u3046\u306b\u8a2d\u5b9a\u3092\u5165\u308c\u308b\u3053\u3068\u3067browser\u306e\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\u3092\u8aad\u307f\u8fbc\u307f\u30c1\u30a7\u30c3\u30af\u5bfe\u8c61\u5916\u306b\u3057\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/eslint.org\/docs\/latest\/use\/configure\/language-options\" target=\"_blank\" rel=\"noopener\"><strong>ESlint\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u300c\u74b0\u5883\u306e\u6307\u5b9a\u300d<\/strong><\/a><\/p>\n\n\n<h4 id=\"outline__5_2_2\" class=\"wp-block-heading\">extends<\/h4>\n\n\n<p>\u4ed6\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3084\u30eb\u30fc\u30eb\u30bb\u30c3\u30c8\u3092\u7d99\u627f\u3059\u308b\u9805\u76ee\u3067\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:default decode:true \"> extends: [\n        \"eslint:recommended\",\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\/\/ eslint\u306e\u63a8\u5968\u30eb\u30fc\u30eb\u8a2d\u5b9a\n        \"plugin:@typescript-eslint\/recommended\",\u3000\u3000\u3000\/\/ TypeScript\u306e\u63a8\u5968\u30eb\u30fc\u30eb\u8a2d\u5b9a\n        \"plugin:vue\/vue3-strongly-recommended\"   \/\/ vue3\u306e\u63a8\u5968\u30eb\u30fc\u30eb\u8a2d\u5b9a\n    ],<\/pre><\/div>\n\n\n<p>\u63a8\u5968\u306e\u30eb\u30fc\u30eb\u30bb\u30c3\u30c8\u3092\u8aad\u307f\u8fbc\u3093\u3067\u3044\u307e\u3059\u304c\u4ed6\u306b\u3082\u30eb\u30fc\u30eb\u30bb\u30c3\u30c8\u304c\u3042\u308b\u306e\u3067\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n\n\n<h4 id=\"outline__5_2_3\" class=\"wp-block-heading\">ignorePatterns<\/h4>\n\n\n<p>ESlint \u306e\u30c1\u30a7\u30c3\u30af\u5bfe\u8c61\u5916\u306b\u3057\u305f\u3044\u30d5\u30a1\u30a4\u30eb\u3092\u6307\u5b9a\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u4eca\u56de\u4f5c\u6210\u3057\u305f.eslintrc.js\u3067\u306f\u3001env\u3067node\u306e\u8a2d\u5b9a\u3092\u3057\u3066\u3044\u306a\u3044\u305f\u3081`module.exports`\u306b\u5bfe\u3057\u3066\u30a8\u30e9\u30fc\u304c\u51fa\u3066\u3057\u307e\u3046\u306e\u3067ignore\u306b\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n<h4 id=\"outline__5_2_4\" class=\"wp-block-heading\">parserOptions<\/h4>\n\n\n<p>ESlint\u304c\u30b3\u30fc\u30c9\u3092\u89e3\u6790\u3059\u308b\u969b\u306e\u5404\u7a2e\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u8a2d\u5b9a\u9805\u76ee\u3067\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:default decode:true \">parserOptions: {\n    ecmaVersion: \"latest\",               \/\/ \u6700\u65b0\u306eECMAScript\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3092\u6307\u5b9a\u3057\u307e\u3059\n    parser: \"@typescript-eslint\/parser\", \/\/ TypeScript\u30b3\u30fc\u30c9\u3092\u89e3\u6790\u3059\u308b\u305f\u3081\u306e\u30d1\u30fc\u30b5\u30fc\u3092\u6307\u5b9a\u3057\u307e\u3059\n    extraFileExtensions: [\".vue\"],       \/\/ \u8ffd\u52a0\u3067\u89e3\u6790\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u62e1\u5f35\u5b50\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\n    sourceType: \"module\",                \/\/ ECMAScript\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u30b7\u30b9\u30c6\u30e0\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u3092\u6307\u5b9a\u3057\u307e\u3059\n    project: \".\/tsconfig.json\",          \/\/ \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306eTypeScript\u306e\u578b\u60c5\u5831\u304cESLint\u306b\u63d0\u4f9b\u3055\u308c\u307e\u3059\n},<\/pre><\/div>\n\n\n\n<h4 id=\"outline__5_2_5\" class=\"wp-block-heading\">plugins<\/h4>\n\n\n<p>ESlint\u306b\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u8aad\u307f\u8fbc\u307e\u305b\u89e3\u6790\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u9805\u76ee\u3002typescript\u3068vue\u306e\u8a2d\u5b9a\u3092\u5165\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n<h4 id=\"outline__5_2_6\" class=\"wp-block-heading\">rules<\/h4>\n\n\n<p>\u3053\u306e\u9805\u76ee\u306b\u306f\u57fa\u672c\u30eb\u30fc\u30eb\u30bb\u30c3\u30c8\u4ee5\u5916\u306e\u7d30\u304b\u306a\u30eb\u30fc\u30eb\u3092\u8ffd\u52a0\u3067\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u4f8b\u3048\u3070&#8221;no-console&#8221;: &#8220;error\u201d\u3068\u8a2d\u5b9a\u3059\u308b\u3068console.log\u3092\u7981\u6b62\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u305f\u308a\u3068\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u30eb\u30fc\u30eb\u3092\u8ffd\u52a0\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/eslint.org\/docs\/latest\/use\/configure\/rules\" target=\"_blank\" rel=\"noopener\"><strong>ESlint\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u300c\u30eb\u30fc\u30eb\u306e\u69cb\u6210\u300d<\/strong><\/a><\/p>\n\n\n<h2 id=\"outline__6\" class=\"wp-block-heading\">Prettier\u306e\u5c0e\u5165<\/h2>\n\n\n\n<h3 id=\"outline__5_1\" class=\"wp-block-heading\">\u5fc5\u8981\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:default decode:true \">npm install --save-dev\u3000\u3000prettier\u3000\u3000eslint-config-prettier<\/pre><\/div>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>\u30d1\u30c3\u30b1\u30fc\u30b8<\/strong><\/td><td><strong>\u5f79\u5272<\/strong><\/td><\/tr><tr><td>prettier<\/td><td>Prettier\u672c\u4f53<\/td><\/tr><tr><td>eslint-config-prettier<\/td><td>Prettier\u3068ESlint\u3067\u7af6\u5408\u3059\u308b\u30eb\u30fc\u30eb\u3092\u30aa\u30d5\u306b\u3059\u308b<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 id=\"outline__6_2\" class=\"wp-block-heading\">\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e\u4f5c\u6210\uff08.prettierrc\uff09<\/h3>\n\n\n<p>\u30eb\u30fc\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b`.prettierrc`\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3066\u9069\u7528\u3057\u305f\u3044\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u8a18\u8f09\u3057\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/prettier.io\/docs\/en\/options.html\" target=\"_blank\" rel=\"noopener\"><strong>Prettier \u30aa\u30d7\u30b7\u30e7\u30f3<\/strong><\/a><\/p>\n\n\n<h3 id=\"outline__6_3\" class=\"wp-block-heading\">.eslintrc.js \u306b\u8a2d\u5b9a\u3092\u8ffd\u52a0<\/h3>\n\n\n<p>extends\u306e\u9805\u76ee\u306b\u201dprettier\u201d\u3092\u8ffd\u52a0\u3057\u9023\u643a\u3055\u305b\u307e\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:default decode:true \">extends: [\n        \"eslint:recommended\",\n        \"plugin:@typescript-eslint\/recommended\",\n        \"plugin:vue\/vue3-strongly-recommended\",\n        \"prettier\"\n    ],<\/pre><\/div>\n\n\n<p>\u6ce8\u610f\u70b9\u3068\u3057\u3066<span class=\"notion-enable-hover\" data-token-index=\"1\">\u201c<\/span><span class=\"notion-enable-hover\" data-token-index=\"2\">prettier<\/span><span class=\"notion-enable-hover\" data-token-index=\"3\">\u201d<\/span>\u306f\u672b\u5c3e\u306b\u5165\u308c\u3066\u304f\u3060\u3055\u3044\u3002 \u6700\u5f8c\u306b\u8aad\u307f\u8fbc\u3080\u3053\u3068\u3067<span class=\"notion-enable-hover\" data-token-index=\"5\">eslint-config-prettier<\/span>\u3067\u30eb\u30fc\u30eb\u306e\u7af6\u5408\u3092\u30aa\u30d5\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n<h2 id=\"outline__7\" class=\"wp-block-heading\">ESlint\u3068Prettier\u3092\u5b9f\u884c\u3057\u3066\u307f\u308b<\/h2>\n\n\n<p>package.json\u306b\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:default decode:true \">\"scripts\": {\n...\n    \"lint\": \"eslint '.\/resources\/**\/*.{js,ts,vue}' &amp;&amp; prettier --write '.\/resources\/**\/*.{js,ts,vue}'\",\n},<\/pre><\/div>\n\n\n<p>\u4eca\u56de\u306fresources\u5185\u306e\u5168\u3066\u306e js\u3001ts\u3001vue \u30d5\u30a1\u30a4\u30eb\u306b\u5bfe\u3057\u3066ESlint\u3068Prettier\u3092\u5b9f\u884c\u3059\u308b\u3088\u3046\u306b\u8a18\u8ff0\u3057\u307e\u3057\u305f\u3002\u3053\u3061\u3089\u306f\u5b9f\u884c\u3057\u305f\u3044\u30d5\u30a1\u30a4\u30eb\u306b\u5fdc\u3058\u3066\u5909\u66f4\u3057\u307e\u3059\u3002\u305d\u3057\u3066\u3001`npm run lint`\u30b3\u30de\u30f3\u30c9\u3092\u53e9\u304f\u3068\u6307\u5b9a\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u306b\u5b9f\u884c\u3057\u3066\u304f\u308c\u307e\u3059\u3002\u3053\u308c\u3067\u5bfe\u8c61\u30d5\u30a1\u30a4\u30eb\u306e\u30b3\u30fc\u30c9\u306b\u554f\u984c\u70b9\u304c\u3042\u308c\u3070\u30ed\u30b0\u306b\u30a8\u30e9\u30fc\u3092\u51fa\u529b\u3057\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:default decode:true \">\"scripts\": {\n...\n    \"lint\": \"eslint --fix '.\/resources\/**\/*.{js,ts,vue}' &amp;&amp; prettier --write '.\/resources\/**\/*.{js,ts,vue}'\",\n},<\/pre><\/div>\n\n\n<p>\u201ceslint &#8211;fix\u201d\u3068\u3059\u308b\u3053\u3068\u3067ESlint\u304c\u5b9f\u884c\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u53ef\u80fd\u306a\u7bc4\u56f2\u3067\u306e\u81ea\u52d5\u4fee\u6b63\u3092\u884c\u3063\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n\n\n<h2 id=\"outline__8\" class=\"wp-block-heading\">VSCode\u3067\u81ea\u52d5\u5316\u3059\u308b<\/h2>\n\n\n<p>\u6700\u5f8c\u306bVScode\u3067\u4fdd\u5b58\u6642\u306b\u81ea\u52d5\u3067\u5b9f\u884c\u3057\u3066\u304f\u308c\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3092\u3057\u307e\u3059\u3002<\/p>\n\n\n<h3 id=\"outline__8_1\" class=\"wp-block-heading\">VSCode \u306e\u62e1\u5f35\u6a5f\u80fd\u3067 ESlint \u3068 Prettier \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/web-img.rensa.jp.net\/rensa\/images\/techmania\/thumbnail\/images\/ESlint.png\" class=\"post-img\">\n\n\n\n<img decoding=\"async\" src=\"https:\/\/web-img.rensa.jp.net\/rensa\/images\/techmania\/thumbnail\/images\/Prettier.png\" class=\"post-img\">\n\n\n\n<h3 id=\"outline__8_2\" class=\"wp-block-heading\">.vscode\/settings.json \u306b\u8a18\u8ff0<\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:default decode:true \">{\n\t\"editor.defaultFormatter\": \"esbenp.prettier-vscode\",\n\t\"editor.formatOnSave\": true,\n\t\n\t\"editor.codeActionsOnSave\": {\n\t    \"source.fixAll.eslint\": true\n}<\/pre><\/div>\n\n\n<p>\u3053\u306e\u8a18\u8ff0\u3067 VSCode \u4fdd\u5b58\u6642\u306b Prettier \u304c\u81ea\u52d5\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3068ESlint\u306e\u81ea\u52d5\u4fee\u6b63\u3092\u3057\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n\n\n<h2 id=\"outline__9\" class=\"wp-block-heading\">\u7d42\u308f\u308a\u306b<\/h2>\n\n\n<p>\u4eca\u56de\u306f\u3001\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u88dc\u52a9\u3059\u308b\u30c4\u30fc\u30eb\u3001ESlint\u3068Prettier\u306b\u3064\u3044\u3066\u7d39\u4ecb\u3057\u307e\u3057\u305f\u304c\u3044\u304b\u304c\u3067\u3057\u305f\u304b\uff1f\u3053\u308c\u3089\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u30b3\u30fc\u30c9\u306e\u53ef\u8aad\u6027\u304c\u4e0a\u304c\u308a\u3001\u4e0d\u5177\u5408\u306b\u306a\u308a\u3046\u308b\u30df\u30b9\u3082\u898b\u3064\u3051\u3084\u3059\u304f\u306a\u308b\u306e\u3067\u3001\u958b\u767a\u52b9\u7387\u3082\u5411\u4e0a\u3057\u307e\u3059\u3002\u7279\u306b\u3001\u30c1\u30fc\u30e0\u958b\u767a\u306e\u3088\u3046\u306a\u8907\u6570\u4eba\u3067\u30b3\u30fc\u30c9\u306b\u89e6\u308c\u308b\u5834\u9762\u3067\u5f79\u7acb\u3061\u307e\u3059\u3002<br \/>\u305c\u3072\u5229\u7528\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\u3053\u306e\u307b\u304b\u306b\u3082\u3001husky\u3084Commitizen\u306a\u3069\u306e\u30c4\u30fc\u30eb\u3092\u5c0e\u5165\u3059\u308b\u3053\u3068\u3067\u30b3\u30df\u30c3\u30c8\u6642\u306b\u81ea\u52d5\u3067\u30b3\u30fc\u30c9\u89e3\u6790\u3092\u3067\u304d\u305f\u308a\u3001\u30b3\u30df\u30c3\u30c8\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u7d71\u4e00\u3067\u304d\u305f\u308a\u3068\u3088\u308a\u4fbf\u5229\u306b\u306a\u308a\u307e\u3059\u3002\u6c17\u306b\u306a\u3063\u305f\u4eba\u306f\u5c0e\u5165\u3059\u308b\u306e\u3082\u826f\u3044\u3067\u3057\u3087\u3046\u3002<\/p>","protected":false},"excerpt":{"rendered":"ESLint\u3068Prettier\u306e\u7d44\u307f\u5408\u308f\u305b\u306f\u30b3\u30fc\u30c9\u306e\u54c1\u8cea\u5411\u4e0a\u3001\u8aad\u307f\u3084\u3059\u3055\u306e\u5411\u4e0a\u3001\u30c1\u30fc\u30e0\u958b\u767a\u306b\u304a\u3051\u308b\u4e00\u8cab\u6027\u306e\u78ba\u4fdd\u306a\u3069\u591a\u304f\u306e\u30e1\u30ea\u30c3\u30c8\u3092\u63d0\u4f9b\u3057\u3066\u304f\u308c\u307e\u3059\u3002 \u672c\u8a18\u4e8b\u3067\u306f\u5b9f\u969b\u306b\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u5c0e\u5165\u3057\u305f\u5185\u5bb9\u306b\u57fa\u3065\u304d ESlint\u3068Prettier\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002 ESlint\u3068\u306f? ESlint(\u30a4\u30fc\u30a8\u30b9\u30ea\u30f3\u30c8)\u3068\u306f\u3001JavaScript\u306e\u30b3\u30fc\u30c9\u304c\u898f\u7d04\u306b\u6cbf\u3063\u3066\u66f8\u304b\u308c\u3066\u3044\u308b\u304b\u3001\u6307\u5b9a\u3057\u305f\u30eb\u30fc\u30eb\u306b\u9055\u53cd\u3057\u3066\u3044\u306a\u3044\u304b\u3092\u30c1\u30a7 [&hellip;]","protected":false},"author":8,"featured_media":5788,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"https:\/\/web-img.rensa.jp.net\/rensa\/images\/techmania\/thumbnail\/images\/eslint0.png","fifu_image_alt":"\u3010ESlint\u5165\u9580\u3011Prettier\u3068\u306e\u4f75\u7528\u3067\u30b3\u30fc\u30c9\u54c1\u8cea\u3092\u5411\u4e0a\u3055\u305b\u308b","footnotes":""},"categories":[15],"tags":[69],"class_list":["post-5753","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-programming","tag-programming"],"_links":{"self":[{"href":"https:\/\/techmania.jp\/blog\/wp-json\/wp\/v2\/posts\/5753","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techmania.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techmania.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techmania.jp\/blog\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/techmania.jp\/blog\/wp-json\/wp\/v2\/comments?post=5753"}],"version-history":[{"count":4,"href":"https:\/\/techmania.jp\/blog\/wp-json\/wp\/v2\/posts\/5753\/revisions"}],"predecessor-version":[{"id":5798,"href":"https:\/\/techmania.jp\/blog\/wp-json\/wp\/v2\/posts\/5753\/revisions\/5798"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techmania.jp\/blog\/wp-json\/wp\/v2\/media\/5788"}],"wp:attachment":[{"href":"https:\/\/techmania.jp\/blog\/wp-json\/wp\/v2\/media?parent=5753"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techmania.jp\/blog\/wp-json\/wp\/v2\/categories?post=5753"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techmania.jp\/blog\/wp-json\/wp\/v2\/tags?post=5753"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}