From 3a66cae6f4ae25d890fce2d2459e2c0573718879 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Mon, 9 Jun 2025 23:28:02 +0800 Subject: [PATCH 1/2] ci: spelling check --- .github/workflows/spelling-check.yml | 14 ++++++++++++++ .github/workflows/typos-config.toml | 7 +++++++ lib/properties/backgroundAttachment.js | 2 +- lib/properties/backgroundColor.js | 2 +- lib/properties/backgroundImage.js | 2 +- lib/properties/backgroundPosition.js | 2 +- lib/properties/backgroundRepeat.js | 2 +- test/CSSStyleDeclaration.test.js | 2 +- 8 files changed, 27 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/spelling-check.yml create mode 100644 .github/workflows/typos-config.toml diff --git a/.github/workflows/spelling-check.yml b/.github/workflows/spelling-check.yml new file mode 100644 index 00000000..99246eec --- /dev/null +++ b/.github/workflows/spelling-check.yml @@ -0,0 +1,14 @@ +name: Spelling Check + +on: [pull_request] + +jobs: + run: + name: Spell Check with Typos + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Check spelling + uses: crate-ci/typos@master + with: + config: .github/workflows/typos-config.toml \ No newline at end of file diff --git a/.github/workflows/typos-config.toml b/.github/workflows/typos-config.toml new file mode 100644 index 00000000..d5cfbff3 --- /dev/null +++ b/.github/workflows/typos-config.toml @@ -0,0 +1,7 @@ +default.check-filename = true + +default.extend-ignore-re = [ + "--foo-Bar-baZ", + "FoNt-SiZe" +] + diff --git a/lib/properties/backgroundAttachment.js b/lib/properties/backgroundAttachment.js index 360e51ba..b50284cf 100644 --- a/lib/properties/backgroundAttachment.js +++ b/lib/properties/backgroundAttachment.js @@ -19,7 +19,7 @@ module.exports.definition = { v = parsers.prepareValue(v, this._global); if (parsers.hasVarFunc(v)) { this._setProperty("background", ""); - this._setProperty("backgound-attachemnt", v); + this._setProperty("background-attachment", v); } else { this._setProperty("background-attachment", module.exports.parse(v)); } diff --git a/lib/properties/backgroundColor.js b/lib/properties/backgroundColor.js index c4d38b26..fdb21cba 100644 --- a/lib/properties/backgroundColor.js +++ b/lib/properties/backgroundColor.js @@ -22,7 +22,7 @@ module.exports.definition = { v = parsers.prepareValue(v, this._global); if (parsers.hasVarFunc(v)) { this._setProperty("background", ""); - this._setProperty("backgound-color", v); + this._setProperty("background-color", v); } else { this._setProperty("background-color", module.exports.parse(v)); } diff --git a/lib/properties/backgroundImage.js b/lib/properties/backgroundImage.js index 5c48df90..c99a2491 100644 --- a/lib/properties/backgroundImage.js +++ b/lib/properties/backgroundImage.js @@ -18,7 +18,7 @@ module.exports.definition = { v = parsers.prepareValue(v, this._global); if (parsers.hasVarFunc(v)) { this._setProperty("background", ""); - this._setProperty("backgound-image", v); + this._setProperty("background-image", v); } else { this._setProperty("background-image", module.exports.parse(v)); } diff --git a/lib/properties/backgroundPosition.js b/lib/properties/backgroundPosition.js index 14d40f6d..80b9452c 100644 --- a/lib/properties/backgroundPosition.js +++ b/lib/properties/backgroundPosition.js @@ -39,7 +39,7 @@ module.exports.definition = { v = parsers.prepareValue(v, this._global); if (parsers.hasVarFunc(v)) { this._setProperty("background", ""); - this._setProperty("backgound-position", v); + this._setProperty("background-position", v); } else { this._setProperty("background-position", module.exports.parse(v)); } diff --git a/lib/properties/backgroundRepeat.js b/lib/properties/backgroundRepeat.js index 90c59977..b67b0c0c 100644 --- a/lib/properties/backgroundRepeat.js +++ b/lib/properties/backgroundRepeat.js @@ -19,7 +19,7 @@ module.exports.definition = { v = parsers.prepareValue(v, this._global); if (parsers.hasVarFunc(v)) { this._setProperty("background", ""); - this._setProperty("backgound-repeat", v); + this._setProperty("background-repeat", v); } else { this._setProperty("background-repeat", module.exports.parse(v)); } diff --git a/test/CSSStyleDeclaration.test.js b/test/CSSStyleDeclaration.test.js index 2fcdd356..fb43ff57 100644 --- a/test/CSSStyleDeclaration.test.js +++ b/test/CSSStyleDeclaration.test.js @@ -269,7 +269,7 @@ describe("CSSStyleDeclaration", () => { assert.strictEqual(style.clear, "right"); style.clear = "both"; assert.strictEqual(style.clear, "both"); - style.clip = "elipse(5px, 10px)"; + style.clip = "ellipse(5px, 10px)"; assert.strictEqual(style.clip, ""); assert.strictEqual(style.length, 1); style.clip = "rect(0, 3Em, 2pt, 50%)"; From d0bca5721bc9efbc09b126021a7e4e47661fe72f Mon Sep 17 00:00:00 2001 From: liweijie0812 <674416404@qq.com> Date: Tue, 10 Jun 2025 19:41:31 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20spelling-check.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/spelling-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spelling-check.yml b/.github/workflows/spelling-check.yml index 99246eec..4bebba74 100644 --- a/.github/workflows/spelling-check.yml +++ b/.github/workflows/spelling-check.yml @@ -11,4 +11,4 @@ jobs: - name: Check spelling uses: crate-ci/typos@master with: - config: .github/workflows/typos-config.toml \ No newline at end of file + config: .github/workflows/typos-config.toml