From 450cfbc9ad278821396098e08bc3edce4330f9f9 Mon Sep 17 00:00:00 2001 From: David Klebanoff Date: Wed, 20 Mar 2019 00:55:03 -0700 Subject: [PATCH] Update lint rules for SVG paths. (#1304) --- .svglintrc.js | 5 +++++ icons/cloudflare.svg | 2 +- icons/haskell.svg | 2 +- icons/netlify.svg | 2 +- icons/youtube.svg | 2 +- 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.svglintrc.js b/.svglintrc.js index 00f04ce7..3238d580 100644 --- a/.svglintrc.js +++ b/.svglintrc.js @@ -17,6 +17,11 @@ module.exports = { { // ensure that the title elm has the appropriate attr "rule::selector": "svg > title", "rule::whitelist": true, + }, + { // ensure that the path element only has the 'd' attr (no style, opacity, etc.) + "d": /^[,a-zA-Z0-9\. -]+$/, + "rule::selector": "svg > path", + "rule::whitelist": true, } ] } diff --git a/icons/cloudflare.svg b/icons/cloudflare.svg index 84e7d8d3..80c4cec7 100644 --- a/icons/cloudflare.svg +++ b/icons/cloudflare.svg @@ -1 +1 @@ -Cloudflare icon +Cloudflare icon diff --git a/icons/haskell.svg b/icons/haskell.svg index ae144e80..c35c010d 100644 --- a/icons/haskell.svg +++ b/icons/haskell.svg @@ -1 +1 @@ -Haskell icon \ No newline at end of file +Haskell icon \ No newline at end of file diff --git a/icons/netlify.svg b/icons/netlify.svg index 25c9452b..18b7bd35 100644 --- a/icons/netlify.svg +++ b/icons/netlify.svg @@ -1 +1 @@ -Netlify icon \ No newline at end of file +Netlify icon \ No newline at end of file diff --git a/icons/youtube.svg b/icons/youtube.svg index 5a4f63c0..6aca43ca 100644 --- a/icons/youtube.svg +++ b/icons/youtube.svg @@ -1 +1 @@ -YouTube icon \ No newline at end of file +YouTube icon \ No newline at end of file