From 60f4f2990e119b0c4ec3b8c2f48b70c0a532ae8c Mon Sep 17 00:00:00 2001 From: ThrawnCA Date: Thu, 23 Nov 2023 10:39:20 +1000 Subject: [PATCH 1/3] Bump eslint-plugin-mdx from 1.17.1 to 2.2.0 Bumps [eslint-plugin-mdx](https://github.com/mdx-js/eslint-mdx) from 1.17.1 to 2.2.0. - [Release notes](https://github.com/mdx-js/eslint-mdx/releases) - [Changelog](https://github.com/mdx-js/eslint-mdx/blob/master/CHANGELOG.md) - [Commits](https://github.com/mdx-js/eslint-mdx/compare/v1.17.1...eslint-plugin-mdx@2.2.0) --- updated-dependencies: - dependency-name: eslint-plugin-mdx dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f75817f7..28d3b758 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "eslint-plugin-jest": "^27.6.0", "eslint-plugin-json": "^3.1.0", "eslint-plugin-jsx-a11y": "^6.8.0", - "eslint-plugin-mdx": "^1.16.0", + "eslint-plugin-mdx": "^2.2.0", "eslint-plugin-prettier": "^4.0.0", "eslint-plugin-react": "^7.33.2", "eslint-plugin-react-hooks": "^4.3.0", From 76abbaae847b6749e03508e527eb5622f2ab43e1 Mon Sep 17 00:00:00 2001 From: ThrawnCA Date: Mon, 20 Nov 2023 16:59:10 +1000 Subject: [PATCH 2/3] disable problematic rules - Switch off rules that seem to be working incorrectly - Change rules to warn-only if they're valid but low priority --- .eslintrc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.eslintrc b/.eslintrc index 791a3555..0e67089f 100644 --- a/.eslintrc +++ b/.eslintrc @@ -16,11 +16,16 @@ } ], "react/jsx-filename-extension": [2, { "extensions": [".js", ".jsx", ".ts", ".tsx", ".mdx"] }], - "import/prefer-default-export": "off", "no-console": ["warn", { "allow": ["warn", "error", "info", "debug"] }], "no-param-reassign": ["error", { "props": false }], "class-methods-use-this": 0, - "import/no-webpack-loader-syntax": "off" + "jsx-a11y/control-has-associated-label": "warn", + + "import/prefer-default-export": "off", + "import/no-webpack-loader-syntax": "off", + "jsx-a11y/anchor-has-content": "off", + "jsx-a11y/heading-has-content": "off", + "react/self-closing-comp": "off", }, "env": { "jest/globals": true @@ -44,4 +49,4 @@ } } ] -} \ No newline at end of file +} From 8350372d8541024a744a60e54660a2c0d7cb9da7 Mon Sep 17 00:00:00 2001 From: ThrawnCA Date: Mon, 20 Nov 2023 17:01:27 +1000 Subject: [PATCH 3/3] make lint happier - Remove unused imports - Remove redundant export names - Give names to inline functions for better stack trace debugging --- src/components/BoilerplateButton/BoilerplateButton.mdx | 1 - .../BoilerplateButton/BoilerplateButton.stories.js | 4 ---- src/components/PdfSubmitButton/PdfSubmitButton.mdx | 1 - src/components/PdfSubmitButton/PdfSubmitButton.stories.js | 4 ---- src/components/PlsPlusAddress/PlsPlusAddress.mdx | 1 - src/components/PlsPlusAddress/PlsPlusAddress.stories.js | 4 ---- src/components/Radio/Radio.mdx | 1 - src/components/googleLocation/GoogleLocation.form.js | 2 +- src/components/googleLocation/GoogleLocation.mdx | 1 - src/components/googleLocation/GoogleLocation.stories.js | 4 ---- .../openStreetMapLocation/OpenStreetMapLocation.form.js | 2 +- .../openStreetMapLocation/OpenStreetMapLocation.js | 2 +- .../openStreetMapLocation/OpenStreetMapLocation.mdx | 1 - .../openStreetMapLocation/OpenStreetMapLocation.stories.js | 4 ---- src/examples/SingleSignOn/SingleSignOn.mdx | 4 ---- src/stories/WhyAndWhen.mdx | 6 +++--- 16 files changed, 6 insertions(+), 36 deletions(-) diff --git a/src/components/BoilerplateButton/BoilerplateButton.mdx b/src/components/BoilerplateButton/BoilerplateButton.mdx index c9c6a069..ca4fd31f 100644 --- a/src/components/BoilerplateButton/BoilerplateButton.mdx +++ b/src/components/BoilerplateButton/BoilerplateButton.mdx @@ -1,5 +1,4 @@ import { Canvas, Meta, Story } from "@storybook/blocks"; -import { createForm, createBuilder } from "../../utils"; import * as BoilerplateButtonStories from "./BoilerplateButton.stories"; diff --git a/src/components/BoilerplateButton/BoilerplateButton.stories.js b/src/components/BoilerplateButton/BoilerplateButton.stories.js index 52b88b6b..acc61c22 100644 --- a/src/components/BoilerplateButton/BoilerplateButton.stories.js +++ b/src/components/BoilerplateButton/BoilerplateButton.stories.js @@ -28,8 +28,6 @@ export const Renderer = { }); }, }), - - name: "Renderer", }; export const Builder = { @@ -46,6 +44,4 @@ export const Builder = { ], }, }), - - name: "Builder", }; diff --git a/src/components/PdfSubmitButton/PdfSubmitButton.mdx b/src/components/PdfSubmitButton/PdfSubmitButton.mdx index d7c47820..11f2dc32 100644 --- a/src/components/PdfSubmitButton/PdfSubmitButton.mdx +++ b/src/components/PdfSubmitButton/PdfSubmitButton.mdx @@ -1,5 +1,4 @@ import { Canvas, Meta, Story } from "@storybook/blocks"; -import { createForm, createBuilder } from "../../utils"; import * as PdfSubmitButtonStories from "./PdfSubmitButton.stories"; diff --git a/src/components/PdfSubmitButton/PdfSubmitButton.stories.js b/src/components/PdfSubmitButton/PdfSubmitButton.stories.js index af42f85f..c52cf669 100644 --- a/src/components/PdfSubmitButton/PdfSubmitButton.stories.js +++ b/src/components/PdfSubmitButton/PdfSubmitButton.stories.js @@ -32,8 +32,6 @@ export const Renderer = { }); }, }), - - name: "Renderer", }; export const RendererForMissingPdf = { @@ -158,6 +156,4 @@ export const Builder = { ], }, }), - - name: "Builder", }; diff --git a/src/components/PlsPlusAddress/PlsPlusAddress.mdx b/src/components/PlsPlusAddress/PlsPlusAddress.mdx index ba828eb4..edd05d9b 100644 --- a/src/components/PlsPlusAddress/PlsPlusAddress.mdx +++ b/src/components/PlsPlusAddress/PlsPlusAddress.mdx @@ -1,5 +1,4 @@ import { Canvas, Meta, Story } from "@storybook/blocks"; -import { createForm, createBuilder } from "../../utils"; import * as PlsPlusAddressStories from "./PlsPlusAddress.stories"; diff --git a/src/components/PlsPlusAddress/PlsPlusAddress.stories.js b/src/components/PlsPlusAddress/PlsPlusAddress.stories.js index 0925d0b6..db84b51d 100644 --- a/src/components/PlsPlusAddress/PlsPlusAddress.stories.js +++ b/src/components/PlsPlusAddress/PlsPlusAddress.stories.js @@ -39,8 +39,6 @@ export const Renderer = { }); }, }), - - name: "Renderer", }; export const Builder = { @@ -68,6 +66,4 @@ export const Builder = { ], }, }), - - name: "Builder", }; diff --git a/src/components/Radio/Radio.mdx b/src/components/Radio/Radio.mdx index 08ea7e2d..789f6595 100644 --- a/src/components/Radio/Radio.mdx +++ b/src/components/Radio/Radio.mdx @@ -1,5 +1,4 @@ import { Canvas, Meta, Story } from "@storybook/blocks"; -import { createForm, createBuilder } from "../../utils"; import * as RadioStories from "./Radio.stories"; diff --git a/src/components/googleLocation/GoogleLocation.form.js b/src/components/googleLocation/GoogleLocation.form.js index 06e9148c..d2df64a2 100644 --- a/src/components/googleLocation/GoogleLocation.form.js +++ b/src/components/googleLocation/GoogleLocation.form.js @@ -2,7 +2,7 @@ import LocationEditMap from "./editForm/Location.edit.map"; const baseEditForm = Formio.Components.components.base.editForm; -export default function (...extend) { +export default function googleLocationFormWrapper(...extend) { return baseEditForm( [ { diff --git a/src/components/googleLocation/GoogleLocation.mdx b/src/components/googleLocation/GoogleLocation.mdx index a47f308a..56b8467b 100644 --- a/src/components/googleLocation/GoogleLocation.mdx +++ b/src/components/googleLocation/GoogleLocation.mdx @@ -1,5 +1,4 @@ import { Canvas, Meta, Story } from "@storybook/blocks"; -import { createForm, createBuilder } from "../../utils"; import * as GoogleLocationStories from "./GoogleLocation.stories"; diff --git a/src/components/googleLocation/GoogleLocation.stories.js b/src/components/googleLocation/GoogleLocation.stories.js index 974593d9..4160ef0b 100644 --- a/src/components/googleLocation/GoogleLocation.stories.js +++ b/src/components/googleLocation/GoogleLocation.stories.js @@ -44,8 +44,6 @@ export const Renderer = { }); }, }), - - name: "Renderer", }; export const Builder = { @@ -78,6 +76,4 @@ export const Builder = { ], }, }), - - name: "Builder", }; diff --git a/src/components/openStreetMapLocation/OpenStreetMapLocation.form.js b/src/components/openStreetMapLocation/OpenStreetMapLocation.form.js index 7fbfa557..59a6f563 100644 --- a/src/components/openStreetMapLocation/OpenStreetMapLocation.form.js +++ b/src/components/openStreetMapLocation/OpenStreetMapLocation.form.js @@ -2,7 +2,7 @@ import OpenStreetMapLocationEditMap from "./editForm/OpenStreetMapLocation.edit. const baseEditForm = Formio.Components.components.base.editForm; -export default function (...extend) { +export default function openStreetMapFormWrapper(...extend) { return baseEditForm( [ { diff --git a/src/components/openStreetMapLocation/OpenStreetMapLocation.js b/src/components/openStreetMapLocation/OpenStreetMapLocation.js index c65cde92..9e47901a 100644 --- a/src/components/openStreetMapLocation/OpenStreetMapLocation.js +++ b/src/components/openStreetMapLocation/OpenStreetMapLocation.js @@ -160,7 +160,7 @@ export class OpenStreetMapLocation extends TextFieldComponent { marker.addTo(element.map); // element.marker = marker; // this.addMarker(defaultLatlng, "Default Marker", element); - marker.on("moveend", function (event) { + marker.on("moveend", function markerMoveListener(event) { // marker.addListener("moveend", (event) => { console.log(event); // const markerInternal = e.target; diff --git a/src/components/openStreetMapLocation/OpenStreetMapLocation.mdx b/src/components/openStreetMapLocation/OpenStreetMapLocation.mdx index 5f541407..b1fe523c 100644 --- a/src/components/openStreetMapLocation/OpenStreetMapLocation.mdx +++ b/src/components/openStreetMapLocation/OpenStreetMapLocation.mdx @@ -1,5 +1,4 @@ import { Canvas, Meta, Story } from "@storybook/blocks"; -import { createForm, createBuilder } from "../../utils"; import * as OpenStreetMapLocationStories from "./OpenStreetMapLocation.stories"; diff --git a/src/components/openStreetMapLocation/OpenStreetMapLocation.stories.js b/src/components/openStreetMapLocation/OpenStreetMapLocation.stories.js index 8ea34075..c614a9b7 100644 --- a/src/components/openStreetMapLocation/OpenStreetMapLocation.stories.js +++ b/src/components/openStreetMapLocation/OpenStreetMapLocation.stories.js @@ -42,8 +42,6 @@ export const Renderer = { }); }, }), - - name: "Renderer", }; export const Renderer2 = { @@ -131,6 +129,4 @@ export const Builder = { ], }, }), - - name: "Builder", }; diff --git a/src/examples/SingleSignOn/SingleSignOn.mdx b/src/examples/SingleSignOn/SingleSignOn.mdx index f6f01244..48721ab8 100644 --- a/src/examples/SingleSignOn/SingleSignOn.mdx +++ b/src/examples/SingleSignOn/SingleSignOn.mdx @@ -1,10 +1,6 @@ import { Canvas, Meta, Story } from "@storybook/blocks"; import SSOHighLevel from "../../stories/assets/SSO-HighLevel.png"; import SSOUserFlow from "../../stories/assets/SSO-UserFlow.png"; -import { SingleSignOn } from "./stories/SingleSignOn"; -import { singleSignOnCode } from "./stories/SingleSignOn.code"; -import { SSOUnauth } from "./stories/SSOUnauth.js"; -import { SSOUnauthCode } from "./stories/SSOUnauth.code.js"; import * as SingleSignOnStories from "./SingleSignOn.stories"; diff --git a/src/stories/WhyAndWhen.mdx b/src/stories/WhyAndWhen.mdx index 4e3f56d7..b43c69e0 100644 --- a/src/stories/WhyAndWhen.mdx +++ b/src/stories/WhyAndWhen.mdx @@ -1,4 +1,4 @@ -import { Meta, Markdown } from "@storybook/addon-docs"; +import { Meta } from "@storybook/addon-docs"; @@ -148,7 +148,7 @@ We will use **Grab my IP** solution as an example. Creation - + custom JS is added as calculated value in the textfield. - +