diff --git a/.eslintrc.json b/.eslintrc.json index 6343730338..acca257a0b 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,5 +1,5 @@ { - "parser": "babel-eslint", + "parser": "@babel/eslint-parser", "plugins": ["prettier"], "extends": ["prettier"], "env": { diff --git a/package.json b/package.json index 1b799d509f..9b7dea3ce4 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ }, "lint-staged": { "*.js": [ - "prettier --print-width 140 --single-quote --parser babylon --write", + "prettier --print-width 140 --single-quote --parser babel --write", "eslint --fix", "git add" ], @@ -70,7 +70,6 @@ "@babel/runtime": "^7.14.6", "abortcontroller-polyfill": "^1.2.3", "autoprefixer": "10.4.14", - "babel-eslint": "^10.0.1", "babel-plugin-istanbul": "^6.0.0", "babelify": "^10.0.0", "backstopjs": "^6.1.4", @@ -142,5 +141,7 @@ "resolutions": { "minimist": "^1.2.5" }, - "dependencies": {} + "dependencies": { + "@babel/eslint-parser": "^7.22.9" + } } diff --git a/src/components/relationships/_macro.spec.js b/src/components/relationships/_macro.spec.js index 5af17e765d..d86b296893 100644 --- a/src/components/relationships/_macro.spec.js +++ b/src/components/relationships/_macro.spec.js @@ -6,7 +6,7 @@ import axe from '../../tests/helpers/axe'; import { renderComponent, templateFaker } from '../../tests/helpers/rendering'; const EXAMPLE_RELATIONSHIPS = { - playback: "Amanda Bloggs is Joe Bloggs' ", + playback: "Amanda Bloggs is Joe Bloggs' ", name: 'relationship', dontWrap: true, legendIsQuestionTitle: true, @@ -18,8 +18,8 @@ const EXAMPLE_RELATIONSHIPS = { text: 'Grandparent', }, attributes: { - 'data-title': 'Thinking of Joe Bloggs, Amanda Bloggs is their grandparents', - 'data-playback': "Amanda Bloggs is Joe Bloggs' grandparents", + 'data-title': 'Thinking of Joe Bloggs, Amanda Bloggs is their grandparents', + 'data-playback': "Amanda Bloggs is Joe Bloggs' grandparents", }, }, { @@ -29,8 +29,8 @@ const EXAMPLE_RELATIONSHIPS = { text: 'Other relation', }, attributes: { - 'data-title': 'Thinking of Joe Bloggs, Amanda Bloggs is their other relation', - 'data-playback': "Amanda Bloggs is Joe Bloggs' other relation", + 'data-title': 'Thinking of Joe Bloggs, Amanda Bloggs is their other relation', + 'data-playback': "Amanda Bloggs is Joe Bloggs' other relation", }, }, { @@ -41,8 +41,8 @@ const EXAMPLE_RELATIONSHIPS = { description: 'Including foster child', }, attributes: { - 'data-title': 'Thinking of Joe Bloggs, Amanda Bloggs is unrelated to Joe Bloggs', - 'data-playback': 'Amanda Bloggs is unrelated to Joe Bloggs', + 'data-title': 'Thinking of Joe Bloggs, Amanda Bloggs is unrelated to Joe Bloggs', + 'data-playback': 'Amanda Bloggs is unrelated to Joe Bloggs', }, }, ], @@ -82,10 +82,8 @@ describe('macro: relationships', () => { it('has the provided `playback` text', () => { const $ = cheerio.load(renderComponent('relationships', EXAMPLE_RELATIONSHIPS)); - const playbackContent = $('.ons-relationships__playback') - .html() - .trim(); - expect(playbackContent).toBe("Amanda Bloggs is Joe Bloggs' "); + const playbackContent = $('.ons-relationships__playback').html().trim(); + expect(playbackContent).toBe("Amanda Bloggs is Joe Bloggs' "); }); it('has playback paragraph hidden initially', async () => { diff --git a/yarn.lock b/yarn.lock index 8fd1e38b99..b72248dd10 100644 --- a/yarn.lock +++ b/yarn.lock @@ -48,6 +48,15 @@ json5 "^2.2.2" semver "^6.3.1" +"@babel/eslint-parser@^7.22.9": + version "7.22.9" + resolved "https://registry.yarnpkg.com/@babel/eslint-parser/-/eslint-parser-7.22.9.tgz#75f8aa978d1e76c87cc6f26c1ea16ae58804d390" + integrity sha512-xdMkt39/nviO/4vpVdrEYPwXCsYIXSSAr6mC7WQsNIlGnuxKyKE7GZjalcnbSWiC4OXGNNN3UQPeHfjSC6sTDA== + dependencies: + "@nicolo-ribaudo/eslint-scope-5-internals" "5.1.1-v1" + eslint-visitor-keys "^2.1.0" + semver "^6.3.1" + "@babel/generator@^7.22.7", "@babel/generator@^7.22.9", "@babel/generator@^7.7.2": version "7.22.9" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.22.9.tgz#572ecfa7a31002fa1de2a9d91621fd895da8493d" @@ -268,7 +277,7 @@ regenerator-runtime "^0.13.11" v8flags "^3.1.1" -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.22.5", "@babel/parser@^7.22.7", "@babel/parser@^7.7.0": +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.22.5", "@babel/parser@^7.22.7": version "7.22.7" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.22.7.tgz#df8cf085ce92ddbdbf668a7f186ce848c9036cae" integrity sha512-7NF8pOkHP5o2vpmGgNGcfAeCvOYhGLyA3Z4eBQkT1RJlWu47n63bCs93QfJ2hIAFCil7L5P2IWhs1oToVgrL0Q== @@ -980,7 +989,7 @@ "@babel/parser" "^7.22.5" "@babel/types" "^7.22.5" -"@babel/traverse@^7.22.6", "@babel/traverse@^7.22.8", "@babel/traverse@^7.7.0", "@babel/traverse@^7.7.2": +"@babel/traverse@^7.22.6", "@babel/traverse@^7.22.8", "@babel/traverse@^7.7.2": version "7.22.8" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.22.8.tgz#4d4451d31bc34efeae01eac222b514a77aa4000e" integrity sha512-y6LPR+wpM2I3qJrsheCTwhIinzkETbplIgPBbwvqPKc+uljeA5gP+3nP8irdYt1mjQaDnlIcG+dw8OjAco4GXw== @@ -996,7 +1005,7 @@ debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.22.5", "@babel/types@^7.3.3", "@babel/types@^7.4.4", "@babel/types@^7.7.0": +"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.22.5", "@babel/types@^7.3.3", "@babel/types@^7.4.4": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.22.5.tgz#cd93eeaab025880a3a47ec881f4b096a5b786fbe" integrity sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA== @@ -1362,6 +1371,13 @@ jpeg-js "^0.4.2" pngjs "^6.0.0" +"@nicolo-ribaudo/eslint-scope-5-internals@5.1.1-v1": + version "5.1.1-v1" + resolved "https://registry.yarnpkg.com/@nicolo-ribaudo/eslint-scope-5-internals/-/eslint-scope-5-internals-5.1.1-v1.tgz#dbf733a965ca47b1973177dc0bb6c889edcfb129" + integrity sha512-54/JRvkLIzzDWshCWfuhadfrfZVPiElY8Fcgmg1HroEly/EDSszzhBAsarCux+D/kOslTRquNzuyGSmUSTTHGg== + dependencies: + eslint-scope "5.1.1" + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -2202,18 +2218,6 @@ axios@^0.25.0: dependencies: follow-redirects "^1.14.7" -babel-eslint@^10.0.1: - version "10.1.0" - resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.1.0.tgz#6968e568a910b78fb3779cdd8b6ac2f479943232" - integrity sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg== - dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/parser" "^7.7.0" - "@babel/traverse" "^7.7.0" - "@babel/types" "^7.7.0" - eslint-visitor-keys "^1.0.0" - resolve "^1.12.0" - babel-jest@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.5.1.tgz#a1bf8d61928edfefd21da27eb86a695bfd691444" @@ -4478,6 +4482,14 @@ eslint-plugin-prettier@^5.0.0: prettier-linter-helpers "^1.0.0" synckit "^0.8.5" +eslint-scope@5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" + integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== + dependencies: + esrecurse "^4.3.0" + estraverse "^4.1.1" + eslint-scope@^7.2.0: version "7.2.1" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.2.1.tgz#936821d3462675f25a18ac5fd88a67cc15b393bd" @@ -4486,10 +4498,10 @@ eslint-scope@^7.2.0: esrecurse "^4.3.0" estraverse "^5.2.0" -eslint-visitor-keys@^1.0.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" - integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== +eslint-visitor-keys@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" + integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1: version "3.4.1" @@ -4567,6 +4579,11 @@ esrecurse@^4.3.0: dependencies: estraverse "^5.2.0" +estraverse@^4.1.1: + version "4.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" + integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== + estraverse@^5.1.0, estraverse@^5.2.0: version "5.3.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" @@ -10330,7 +10347,7 @@ resolve.exports@^1.1.0: resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-1.1.1.tgz#05cfd5b3edf641571fd46fa608b610dda9ead999" integrity sha512-/NtpHNDN7jWhAaQ9BvBUYZ6YTXsRBgfqWFWP7BZBaoMJO/I3G5OFzvTuWNlZC3aPjins1F+TNrLKsGbH4rfsRQ== -resolve@^1.1.4, resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, resolve@^1.12.0, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.20.0, resolve@^1.3.3, resolve@^1.4.0: +resolve@^1.1.4, resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.20.0, resolve@^1.3.3, resolve@^1.4.0: version "1.22.2" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.2.tgz#0ed0943d4e301867955766c9f3e1ae6d01c6845f" integrity sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==