From ea441840de1c50a03eca1c68d7fd4b0cd54d0047 Mon Sep 17 00:00:00 2001 From: Joe Haig Date: Fri, 20 Oct 2023 21:34:26 +0100 Subject: [PATCH] Add Response to the globals list For some reason Response is not being recognised even though it is part of Javascript (https://caniuse.com/?search=Response). This is possibly due to out of date dependencies preventing ES6 coding standards being checkd. It is added to the list of globals to allow `yarn standard` to pass. It may be possible to remove this after refactoring. --- docs/javascript_restructure.md | 10 +++++++++- package.json | 5 +++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/docs/javascript_restructure.md b/docs/javascript_restructure.md index c6714a25ac..01bd47e036 100644 --- a/docs/javascript_restructure.md +++ b/docs/javascript_restructure.md @@ -97,4 +97,12 @@ npx jasmine-browser-runner serve and then view the output at http://localhost:8888 -In particular, this makes it possible to view the output of `console.log`. \ No newline at end of file +In particular, this makes it possible to view the output of `console.log`. + +### Linting + +`yarn standard` will complain about the use of `Response` in `app/webpack/javascripts/modules/determination_spec.mjs` +(for example) even though it is part of [ES6.](https://caniuse.com/mdn-api_response_response) +This is due to some dependencies that, it is hoped, will be removed after the +cleanup is completed. `"Response"` is added to the `globals` section of the +`standard` configuration in `package.json`. \ No newline at end of file diff --git a/package.json b/package.json index 2a2e1e9cfe..8495018ff1 100644 --- a/package.json +++ b/package.json @@ -79,11 +79,12 @@ "globals": [ "GOVUK", "moj", - "Stickyfill" + "Stickyfill", + "Response" ], "ignore": [ "app/webpack/javascripts/vendor/", "spec/javascripts/helpers/" ] } -} +} \ No newline at end of file