From 872f1902f16c39933a490451003a7085f93c4fc2 Mon Sep 17 00:00:00 2001 From: Marc G Date: Fri, 23 Dec 2022 02:38:05 +0100 Subject: [PATCH] fix: add some requested missing functions from css-functions-list package --- lib/rules/function-no-unknown/__tests__/index.js | 6 ++++++ lib/rules/function-no-unknown/index.js | 11 ++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/rules/function-no-unknown/__tests__/index.js b/lib/rules/function-no-unknown/__tests__/index.js index 3dab33c82e..4e62855a47 100644 --- a/lib/rules/function-no-unknown/__tests__/index.js +++ b/lib/rules/function-no-unknown/__tests__/index.js @@ -19,6 +19,12 @@ testRule({ { code: 'a { transform: scale(0.5) translate(-100%, -100%); }', }, + { + code: 'a { animation-timeline: scroll(); }', + }, + { + code: 'a { background: -webkit-gradient(linear, 0 50%, 0 100%, from(white), color-stop(0.5, yellow), to(red)); }', + }, ], reject: [ diff --git a/lib/rules/function-no-unknown/index.js b/lib/rules/function-no-unknown/index.js index 467a33a681..82a6699605 100644 --- a/lib/rules/function-no-unknown/index.js +++ b/lib/rules/function-no-unknown/index.js @@ -43,7 +43,16 @@ const rule = (primary, secondaryOptions) => { return; } - const functionsList = JSON.parse(fs.readFileSync(functionsListPath.toString(), 'utf8')); + const functionsList = [ + ...JSON.parse(fs.readFileSync(functionsListPath.toString(), 'utf8')), + // #5960 + '-webkit-gradient', + 'color-stop', + 'from', + 'to', + // #6537 + 'scroll', + ]; root.walkDecls((decl) => { const { value } = decl;