{"id":443,"date":"2025-03-31T01:01:41","date_gmt":"2025-03-30T16:01:41","guid":{"rendered":"https:\/\/shugomatsuzawa.com\/techblog\/?p=443"},"modified":"2025-03-31T01:01:43","modified_gmt":"2025-03-30T16:01:43","slug":"%e3%82%b0%e3%83%ad%e3%83%bc%e3%83%90%e3%83%ab%e3%81%aestylelint%e3%81%a7vs-code%e3%81%aecss%e3%83%aa%e3%83%b3%e3%82%bf%e3%83%bc%e3%82%92%e6%8b%a1%e5%bc%b5%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/shugomatsuzawa.com\/techblog\/2025\/03\/31\/443\/","title":{"rendered":"\u30b0\u30ed\u30fc\u30d0\u30eb\u306eStylelint\u3067VS Code\u306eCSS\u30ea\u30f3\u30bf\u30fc\u3092\u62e1\u5f35\u3059\u308b"},"content":{"rendered":"\n<p>\u6700\u8fd1CSS\u5909\u6570\u306e\u9593\u9055\u3044\u3084\u30bf\u30a4\u30d7\u30df\u30b9\u304c\u6016\u304f\u3066\u3001VS Code\u5185\u8535\u306eCSS\u30ea\u30f3\u30bf\u30fc\u306b\u9650\u754c\u3092\u611f\u3058\u3066\u3044\u305f\u3002<br>\u4f55\u304b\u3044\u3044\u3082\u306e\u306f\u306a\u3044\u304b\u3068\u63a2\u3057\u3066\u3044\u305f\u3068\u3053\u308d\u3001Stylelint\u3092\u4f7f\u3048\u3070\u3055\u307e\u3056\u307e\u306a\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u4f7f\u3063\u3066\u8272\u3005\u306a\u30df\u30b9\u3092\u691c\u77e5\u3067\u304d\u308b\u3089\u3057\u3044\u3002<\/p>\n\n\n\n<p>\u3057\u304b\u3057\u6211\u3005\u306e\u30c1\u30fc\u30e0\u3067\u306fCSS\u3092\u66f8\u304f\u4eba\u9593\u306f\u9650\u3089\u308c\u3066\u304a\u308a\u3001CSS\u3092\u8907\u6570\u4eba\u3067\u66f8\u304f\u3053\u3068\u3082\u3042\u307e\u308a\u306a\u3044\u72b6\u6cc1\u3002<br><code>package.json<\/code>\u3092\u6c5a\u3059\u306e\u3082\u5acc\u3060\u3063\u305f\u306e\u3067\u3001\u307e\u305a\u306f\u304a\u8a66\u3057\u3067\u30b0\u30ed\u30fc\u30d0\u30eb\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u4f7f\u3063\u3066\u307f\u305f\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Stylelint\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n\n\n\n<p>\u4eca\u56de\u306fCSS\u5909\u6570\u306e\u30df\u30b9\u3092\u691c\u77e5\u3059\u308b<a href=\"https:\/\/github.com\/csstools\/stylelint-value-no-unknown-custom-properties\" data-type=\"link\" data-id=\"https:\/\/github.com\/csstools\/stylelint-value-no-unknown-custom-properties\" target=\"_blank\" rel=\"noreferrer noopener\"><code>stylelint-value-no-unknown-custom-properties<\/code>\u30d7\u30e9\u30b0\u30a4\u30f3<\/a>\u304c\u4f7f\u3048\u308b\u3088\u3046\u306b\u3059\u308b\u3053\u3068\u3092\u76ee\u6307\u3059\u3002<\/p>\n\n\n\n<p>\u307e\u305a\u306f\u5fc5\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30b0\u30ed\u30fc\u30d0\u30eb\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm install -g stylelint stylelint-value-no-unknown-custom-properties postcss<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">VS Code\u62e1\u5f35\u6a5f\u80fd\u306e\u8a2d\u5b9a<\/h2>\n\n\n\n<p>\u516c\u5f0f\u306e<a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=stylelint.vscode-stylelint\" data-type=\"link\" data-id=\"https:\/\/marketplace.visualstudio.com\/items?itemName=stylelint.vscode-stylelint\" target=\"_blank\" rel=\"noreferrer noopener\">Stylelint VS Code\u62e1\u5f35\u6a5f\u80fd<\/a>\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002<br>\u3053\u306e\u62e1\u5f35\u6a5f\u80fd\u3092\u6709\u52b9\u306b\u3059\u308b\u3068\u3001\u307e\u305a\u73fe\u5728\u306e\u30ef\u30fc\u30af\u30b9\u30da\u30fc\u30b9\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u305fStylelint\u3092\u63a2\u3057\u3001\u898b\u3064\u304b\u3089\u306a\u3051\u308c\u3070\u30b0\u30ed\u30fc\u30d0\u30eb\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u305fStylelint\u3092\u81ea\u52d5\u7684\u306b\u8aad\u307f\u8fbc\u3093\u3067\u304f\u308c\u308b\u3002<\/p>\n\n\n\n<p>\u672c\u6765\u3067\u3042\u308c\u3070<code>npm init stylelint<\/code>\u3067\u4f5c\u6210\u3055\u308c\u305fStylelint\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u4f7f\u7528\u3059\u308b\u304c\u3001\u4eca\u56de\u306f\u500b\u4eba\u3067\u4f7f\u3046\u3060\u3051\u306a\u306e\u3067VS Code\u5074\u3067<code>stylelint.config<\/code>\u8a2d\u5b9a\u306b\u76f4\u63a5\u8a18\u8ff0\u3059\u308b\u3002<br><code>stylelint.config<\/code>\u3092\u4f7f\u7528\u3059\u308b\u3068\u30ef\u30fc\u30af\u30b9\u30da\u30fc\u30b9\u4e0a\u306eStylelint\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306f\u8aad\u307f\u8fbc\u307e\u308c\u306a\u3044\u306e\u3067\u6ce8\u610f\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n    \"stylelint.config\": {\n        \"plugins\": &#91;\n            \"stylelint-value-no-unknown-custom-properties\"\n        ],\n        \"rules\": {\n            \"csstools\/value-no-unknown-custom-properties\": true\n        }\n    }\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u53c2\u8003<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/zenn.dev\/cside\/articles\/96f09354cd2000\" data-type=\"link\" data-id=\"https:\/\/zenn.dev\/cside\/articles\/96f09354cd2000\" target=\"_blank\" rel=\"noreferrer noopener\">CSS \u306e\u8a18\u8ff0\u30df\u30b9\u3092\u7de8\u96c6\u4e2d\u306b\u81ea\u52d5\u3067\u691c\u51fa\u3059\u308b\u30c6\u30af\u30cb\u30c3\u30af<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/stylelint.io\" data-type=\"link\" data-id=\"https:\/\/stylelint.io\" target=\"_blank\" rel=\"noreferrer noopener\">Home | Stylelint<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=stylelint.vscode-stylelint\" data-type=\"link\" data-id=\"https:\/\/marketplace.visualstudio.com\/items?itemName=stylelint.vscode-stylelint\" target=\"_blank\" rel=\"noreferrer noopener\">Stylelint &#8211; Visual Studio Marketplace<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/github.com\/csstools\/stylelint-value-no-unknown-custom-properties\" data-type=\"link\" data-id=\"https:\/\/github.com\/csstools\/stylelint-value-no-unknown-custom-properties\">csstools\/stylelint-value-no-unknown-custom-properties: A stylelint rule to catch usage of unknown custom properties<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"\u6700\u8fd1\u3001CSS\u306e\u30bf\u30a4\u30d7\u30df\u30b9\u3092\u9632\u3050\u305f\u3081\u306bStylelint\u3092\u5c0e\u5165\u3057\u305f\u3002\u7279\u306bCSS\u5909\u6570\u306e\u30df\u30b9\u3092\u691c\u77e5\u3059\u308b\u305f\u3081\u306b\u5fc5\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30b0\u30ed\u30fc\u30d0\u30eb\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3001VS Code\u306e\u62e1\u5f35\u6a5f\u80fd\u3092\u8a2d\u5b9a\u3002\u500b\u4eba\u4f7f\u7528\u306e\u305f\u3081\u3001\u76f4\u63a5\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306b\u5fc5\u8981\u306a\u30d7\u30e9\u30b0\u30a4\u30f3\u3068\u30eb\u30fc\u30eb\u3092\u8a18\u8ff0\u3057\u305f\u3002","protected":false},"author":1,"featured_media":446,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"federate","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[47],"tags":[50,14,102,91,10],"class_list":["post-443","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-frontend","tag-css","tag-npm","tag-stylelint","tag-vs-code","tag-memo"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/shugomatsuzawa.com\/techblog\/wp-content\/uploads\/sites\/3\/2025\/03\/file-7084005_1920.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/posts\/443","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/comments?post=443"}],"version-history":[{"count":3,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/posts\/443\/revisions"}],"predecessor-version":[{"id":447,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/posts\/443\/revisions\/447"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/media\/446"}],"wp:attachment":[{"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/media?parent=443"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/categories?post=443"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/tags?post=443"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}