From 8766277e44f7689f2c27d4a03f2cd73559731f1b Mon Sep 17 00:00:00 2001
From: anujaraj <52713215+anujaraj@users.noreply.github.com>
Date: Wed, 22 Jun 2022 21:41:15 +0530
Subject: [PATCH] fix issue where linting/formatting npm scripts would not work
 on Windows

- linting bug changes to allow it working for both windows and mac
- resolving linting issues for windows in lint:format to allow prettier to run
---
 CHANGELOG.txt        | 1 +
 docs/releases/4.0.md | 1 +
 package.json         | 4 ++--
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 414fddc9da..27d8c91b31 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -69,6 +69,7 @@ Changelog
  * Fix: Ensure that `DecimalBlock` preserves the `Decimal` type when retrieving from the database (Yves Serrano)
  * Fix: When no snippets are added, ensure the snippet chooser modal would have the correct URL for creating a new snippet (Matt Westcott)
  * Fix: `ngettext` in Wagtail's internal JavaScript internationalisation utilities now works (LB (Ben) Johnston)
+ * Fix: Ensure the linting/formatting npm scripts work on Windows (Anuja Verma)
 
 
 3.0.1 (16.06.2022)
diff --git a/docs/releases/4.0.md b/docs/releases/4.0.md
index 85f6157aad..2c248534ed 100644
--- a/docs/releases/4.0.md
+++ b/docs/releases/4.0.md
@@ -81,6 +81,7 @@ When using a queryset to render a list of images, you can now use the `prefetch_
  * Ensure that `DecimalBlock` preserves the `Decimal` type when retrieving from the database (Yves Serrano)
  * When no snippets are added, ensure the snippet chooser modal would have the correct URL for creating a new snippet (Matt Westcott)
  * `ngettext` in Wagtail's internal JavaScript internationalisation utilities now works (LB (Ben) Johnston)
+ * Ensure the linting/formatting npm scripts work on Windows (Anuja Verma)
 
 
 ## Upgrade considerations
diff --git a/package.json b/package.json
index c2acd5e3fe..29a069a3bf 100644
--- a/package.json
+++ b/package.json
@@ -121,10 +121,10 @@
     "start": "webpack --config ./client/webpack.config.js --mode development --progress --watch",
     "build": "webpack --config ./client/webpack.config.js --mode production",
     "fix:js": "eslint --ext .js,.ts,.tsx --fix .",
-    "format": "prettier --write '**/?(.)*.{css,scss,js,ts,tsx,json,yaml,yml}'",
+    "format": "prettier --write \"**/?(.)*.{css,scss,js,ts,tsx,json,yaml,yml}\"",
     "lint:js": "eslint --ext .js,.ts,.tsx --report-unused-disable-directives .",
     "lint:css": "stylelint **/*.scss",
-    "lint:format": "prettier --check '**/?(.)*.{css,scss,js,ts,tsx,json,yaml,yml}'",
+    "lint:format": "prettier --check \"**/?(.)*.{css,scss,js,ts,tsx,json,yaml,yml}\"",
     "lint": "npm run lint:js && npm run lint:css && npm run lint:format",
     "test": "npm run test:unit",
     "test:unit": "jest",