From cc1ce0817cc954e7d3d193874a59f31d468966ce Mon Sep 17 00:00:00 2001 From: "Nicholas C. Zakas" Date: Thu, 9 Feb 2023 10:30:03 -0800 Subject: [PATCH] chore: Add lint:fix script and fix linting errors --- package.json | 1 + src/astro-jekyll.js | 2 +- tests/astro-jekyll.test.js | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 7f66b65..233f0a4 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "build": "rollup -c && tsc", "prepare": "npm run build", "lint": "eslint src/ tests/", + "lint:fix": "eslint --fix src/ tests/", "pretest": "npm run build", "test": "c8 mocha tests/*.test.js" }, diff --git a/src/astro-jekyll.js b/src/astro-jekyll.js index e7862cc..2d1f596 100644 --- a/src/astro-jekyll.js +++ b/src/astro-jekyll.js @@ -9,7 +9,7 @@ // Data //----------------------------------------------------------------------------- -const DATETIME = /^(\d{4})-(\d{2})-(\d{2})(?:\s+(\d{2})(?::(\d{2})(?::(\d{2}))?)?(?:\s*([+-]\d{4}))?)?/ +const DATETIME = /^(\d{4})-(\d{2})-(\d{2})(?:\s+(\d{2})(?::(\d{2})(?::(\d{2}))?)?(?:\s*([+-]\d{4}))?)?/; /** * Parses a Jekyll-formatted datetime into a JavaScipt Date object. diff --git a/tests/astro-jekyll.test.js b/tests/astro-jekyll.test.js index a2b38ad..ae9d200 100644 --- a/tests/astro-jekyll.test.js +++ b/tests/astro-jekyll.test.js @@ -24,7 +24,7 @@ describe("parseJekyllDateTime()", () => { it(`should return undefined for invalid datetime string: "${input}"`, () => { expect(parseJekyllDateTime(input)).to.be.undefined; }); - }) + }); it("should add hours automatically when not supplied", () => { const input = "2023-01-02";