{"id":2231,"date":"2021-10-12T10:25:08","date_gmt":"2021-10-12T01:25:08","guid":{"rendered":"https:\/\/sirius10.net\/blog\/wordpress\/?p=2231"},"modified":"2021-10-12T10:25:10","modified_gmt":"2021-10-12T01:25:10","slug":"post-2231","status":"publish","type":"post","link":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/2021\/10\/12\/2231\/","title":{"rendered":"stylelint \u3092\u8a66\u3057\u3066\u307f\u308b"},"content":{"rendered":"\n<p>\u3000CSS \u306e\u6587\u6cd5\u30c1\u30a7\u30c3\u30af\u3092\u8a66\u3057\u3066\u307f\u307e\u3059\u3002npm \u3067\u30ed\u30fc\u30ab\u30eb\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n\n\n\n<p>\u3000\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5f8c\u306b\u8a2d\u5b9a\u304c\u5fc5\u8981\u3067\u3059\u3002.stylelintrc.json \u3092\u65b0\u3057\u304f\u4f5c\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted console\">$ sudo mkdir \/opt\/stylelint\n$ cd \/opt\/stylelint\n$ sudo npm install --save-dev stylelint stylelint-config-standard\n$ sudo vi .stylelintrc.json<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted file\">{\n  \"extends\": \"stylelint-config-standard\"\n}<\/pre>\n\n\n\n<p>\u3000\u3053\u308c\u3067 OK \u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30c1\u30a7\u30c3\u30af<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted console\">$ npx stylelint css\u30d5\u30a1\u30a4\u30eb<\/pre>\n\n\n\n<p>\u3000minify \u3057\u305f\u3082\u306e\u306f\u30a8\u30e9\u30fc\u304c\u51fa\u307e\u304f\u308a\u307e\u3057\u305f\u3002\u30c1\u30a7\u30c3\u30af\u306f minify \u3059\u308b\u524d\u306e\u30d5\u30a1\u30a4\u30eb\u3067\u3084\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3000\u4e00\u5ea6\u3082\u6587\u6cd5\u30c1\u30a7\u30c3\u30af\u3057\u305f\u3053\u3068\u304c\u306a\u3044\u306e\u3067\u30a8\u30e9\u30fc\u304c\u51fa\u307e\u304f\u308a\u307e\u3057\u305f\u304c\u3001\u3061\u3087\u3063\u3068\u53b3\u3057\u3059\u304e\u308b\u304f\u3089\u3044\u30c1\u30a7\u30c3\u30af\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u3053\u307e\u3067\u3084\u3089\u306a\u304f\u3066\u3082\u554f\u984c\u306a\u3044\u306e\u3067\u3059\u304c\u3001\u30a8\u30e9\u30fc\u3092\u898b\u308b\u3068\u76f4\u3057\u305f\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30002 \u7b87\u6240\u3060\u3051\u3001\u3069\u3046\u4fee\u6b63\u3059\u308c\u3070\u3044\u3044\u304b\u308f\u304b\u3089\u306a\u3044\u70b9\u3092\u9664\u3044\u3066\u5168\u90e8\u4fee\u6b63\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">SHELL \u30b9\u30af\u30ea\u30d7\u30c8\u3067\u5b9f\u884c<\/h2>\n\n\n\n<p>\u3000htmlHint \u3068\u540c\u3058\u69d8\u306b SHELL \u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f5c\u3063\u3066\u4f55\u51e6\u304b\u3089\u3067\u3082\u5b9f\u884c\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted console\">$ sudo vi \/usr\/local\/bin\/stylelint<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted file\">#!\/bin\/bash\n\nINSTALL_DIR=\/opt\/stylelint\n\nif [ -f \"${PWD}\/$1\" ]; then\n    file=\"${PWD}\/$1\"\nelse\n    file=\"$1\"\nfi\n\ncd ${INSTALL_DIR}\nnpx stylelint \"${file}\"<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted console\">$ sudo chmod +x \/usr\/local\/bin\/stylelint<\/pre>\n\n\n\n<p>\u3000\u6b21\u306f\u3001ESlint \u304b\u306a<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3000CSS \u306e\u6587\u6cd5\u30c1\u30a7\u30c3\u30af\u3092\u8a66\u3057\u3066\u307f\u307e\u3059\u3002npm \u3067\u30ed\u30fc\u30ab\u30eb\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002 \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb \u3000\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5f8c\u306b\u8a2d\u5b9a\u304c\u5fc5\u8981\u3067\u3059\u3002.stylelintrc.json \u3092\u65b0\u3057\u304f\u4f5c\u308a\u307e\u3059\u3002 $ sudo mkdir \/opt\/ [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[],"class_list":["post-2231","post","type-post","status-publish","format-standard","hentry","category-web"],"_links":{"self":[{"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/2231","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/comments?post=2231"}],"version-history":[{"count":3,"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/2231\/revisions"}],"predecessor-version":[{"id":2237,"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/2231\/revisions\/2237"}],"wp:attachment":[{"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/media?parent=2231"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/categories?post=2231"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/tags?post=2231"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}