From 7da9e9086f903be5060fe85a2b29597c1d01db83 Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Sat, 8 Jun 2024 23:22:28 -0400 Subject: [PATCH] chore: Upgrade to Prettier v3 - Update to v3 - Ignore HTML, generated files, and yamllint - Autofix for change in trailing comma style - Keep YML/YAML files with double quotes consistently --- .github/workflows/ci.yml | 1 - .github/workflows/dependencies.yml | 2 +- .github/workflows/lint-js.yml | 1 - .github/workflows/lint-yml.yml | 1 - .../markdownlint-problem-matcher.json | 26 +++++++++---------- .github/workflows/sync-french.yml | 1 - .licensee.json | 6 +---- .markdownlint-cli2.jsonc | 6 ++--- .prettierignore | 6 +++++ .prettierrc | 10 ++++++- CONTRIBUTING.md | 2 +- README.md | 26 ++++++++++--------- assets/gridify.css | 20 ++++++++------ assets/js/src/adminForm.js | 2 +- assets/js/src/codeForm.js | 18 ++++++------- assets/js/src/custom-form-validation.js | 14 +++++----- assets/js/src/designForm.js | 18 ++++++------- assets/js/src/designType.js | 4 +-- assets/js/src/git-file-manager.js | 2 +- assets/js/src/more-group.js | 4 +-- assets/js/src/partners.js | 16 ++++++------ assets/js/src/partnershipForm.js | 16 ++++++------ assets/js/src/programmingLanguages.js | 6 ++--- assets/js/src/softwareForm.js | 20 +++++++------- assets/js/src/standardForm.js | 20 +++++++------- assets/style.css | 18 ++++++------- cypress.json | 4 +-- cypress/fixtures/example.json | 2 +- package-lock.json | 12 ++++----- package.json | 6 ++--- 30 files changed, 151 insertions(+), 139 deletions(-) create mode 100644 .prettierignore diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f92d020ee..d291a266e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,6 @@ on: jobs: build: - runs-on: ubuntu-latest steps: diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml index b099ec004..4bd865ad4 100644 --- a/.github/workflows/dependencies.yml +++ b/.github/workflows/dependencies.yml @@ -2,7 +2,7 @@ name: Dependencies parser on: schedule: - - cron: '0 0 * * *' + - cron: "0 0 * * *" repository_dispatch: push: branches: diff --git a/.github/workflows/lint-js.yml b/.github/workflows/lint-js.yml index de809ac5f..a43a5852a 100644 --- a/.github/workflows/lint-js.yml +++ b/.github/workflows/lint-js.yml @@ -20,7 +20,6 @@ on: jobs: build: - runs-on: ubuntu-latest steps: diff --git a/.github/workflows/lint-yml.yml b/.github/workflows/lint-yml.yml index 6a1f3279c..e3bb1f4cc 100644 --- a/.github/workflows/lint-yml.yml +++ b/.github/workflows/lint-yml.yml @@ -18,7 +18,6 @@ on: jobs: build: - runs-on: ubuntu-latest steps: diff --git a/.github/workflows/markdownlint-problem-matcher.json b/.github/workflows/markdownlint-problem-matcher.json index f0741f6b9..c37cf8bd7 100644 --- a/.github/workflows/markdownlint-problem-matcher.json +++ b/.github/workflows/markdownlint-problem-matcher.json @@ -1,17 +1,17 @@ { - "problemMatcher": [ + "problemMatcher": [ + { + "owner": "markdownlint", + "pattern": [ { - "owner": "markdownlint", - "pattern": [ - { - "regexp": "^([^:]*):(\\d+):?(\\d+)?\\s([\\w-\\/]*)\\s(.*)$", - "file": 1, - "line": 2, - "column": 3, - "code": 4, - "message": 5 - } - ] + "regexp": "^([^:]*):(\\d+):?(\\d+)?\\s([\\w-\\/]*)\\s(.*)$", + "file": 1, + "line": 2, + "column": 3, + "code": 4, + "message": 5 } - ] + ] + } + ] } diff --git a/.github/workflows/sync-french.yml b/.github/workflows/sync-french.yml index 85b0740ca..7f19fcdd4 100644 --- a/.github/workflows/sync-french.yml +++ b/.github/workflows/sync-french.yml @@ -12,7 +12,6 @@ on: jobs: build: - runs-on: ubuntu-latest if: github.repository_owner == 'canada-ca' diff --git a/.licensee.json b/.licensee.json index 830b32495..53687e783 100644 --- a/.licensee.json +++ b/.licensee.json @@ -1,10 +1,6 @@ { "licenses": { - "spdx": [ - "CC-BY-3.0", - "CC0-1.0", - "Unlicense" - ], + "spdx": ["CC-BY-3.0", "CC0-1.0", "Unlicense"], "osi": true }, "packages": { diff --git a/.markdownlint-cli2.jsonc b/.markdownlint-cli2.jsonc index c8237f21b..c63e5ffee 100644 --- a/.markdownlint-cli2.jsonc +++ b/.markdownlint-cli2.jsonc @@ -3,11 +3,11 @@ "default": true, "MD013": false, "MD024": { - "siblings_only": true + "siblings_only": true, }, "MD025": false, "MD026": false, - "MD041": false + "MD041": false, }, - "ignores": ["node_modules", "_data/spdx"] + "ignores": ["node_modules", "_data/spdx"], } diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 000000000..73c89dee5 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,6 @@ +_data/ +_data_templates/ +_site/ +assets/js/lib/ +*.html +.yamllint.yaml diff --git a/.prettierrc b/.prettierrc index 937375d24..fdfd626dd 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,4 +1,12 @@ { "semi": true, - "singleQuote": true + "singleQuote": true, + "overrides": [ + { + "files": ["**/*.yml", "**/*.yaml"], + "options": { + "singleQuote": false + } + } + ] } diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 96183b51f..bebc1c974 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,7 +14,7 @@ If this is your first time contributing on GitHub, don't worry! Let us know if y -______________________ +--- ## Comment contribuer diff --git a/README.md b/README.md index 0ea57f551..30e2c89d3 100644 --- a/README.md +++ b/README.md @@ -28,19 +28,20 @@ Notes: - If Jekyll is not automatically regenerating the site after files are modified, add the build command flags: `--watch` and `--force_polling` to the end of the above command Site will be available at: -______________________ + +--- ### Javascript If you're working on Javascript in the `/assets/js/src` folder, make sure your code follows the style guidelines. We use ES Lint for checking code style. Ensure you have a recent version of Node.js (>=10.15.3). Run the following to install dependencies. -``` bash +```bash npm install ``` Now when you want to know if your code is following the guidelines, run -``` bash +```bash npm run lint ``` @@ -81,19 +82,19 @@ This service is hosted in [Heroku](https://dashboard.heroku.com/apps/canada-pr-b First, clone PRB0t to your machine. -``` bash +```bash git clone https://github.com/PRB0t/PRB0t ``` Next, add our app as a remote git repository. -``` bash +```bash heroku git:remote -a canada-pr-bot ``` And finally, push your changes. -``` bash +```bash git push heroku master ``` @@ -125,19 +126,20 @@ Remarques: - Si Jekyll ne régénère pas automatiquement le site une fois les fichiers modifiés, ajoutez les indicateurs: `--watch` et `--force_polling` à la fin de la commande ci-dessus Le site sera disponible au: -______________________ + +--- ### Javascript Si vous travaillez sur Javascript dans le dossier `/assets/js/src`, assurez-vous que votre code respecte les directives de style. Nous utilisons ES Lint pour vérifier le style de code. Assurez-vous de disposer d'une version récente de Node.js (>=10.15.3). Exécutez ce qui suit pour installer des dépendances. -``` bash +```bash npm install ``` Lorsque vous voulez savoir si votre code suit les directives de style, exécutez -``` bash +```bash npm run lint ``` @@ -178,18 +180,18 @@ Ce service est hébergé sur [Heroku](https://dashboard.heroku.com/apps/canada-p Commencez par cloner PRB0t sur votre machine. -``` bash +```bash git clone https://github.com/PRB0t/PRB0t ``` Ensuite, ajoutez notre application en tant que dépôt git distant. -``` bash +```bash heroku git:remote -a canada-pr-bot ``` Et enfin, poussez vos modifications. -``` bash +```bash git push heroku master ``` diff --git a/assets/gridify.css b/assets/gridify.css index 4fc01c0f6..84cdd26cf 100644 --- a/assets/gridify.css +++ b/assets/gridify.css @@ -12,8 +12,8 @@ } .tbl-gridify td:first-child { - padding-top:15px; - background:#f5f5f5; + padding-top: 15px; + background: #f5f5f5; color: #333; border: 1px solid #8e8e8e; border-top-right-radius: 5px; @@ -26,18 +26,22 @@ border-bottom-left-radius: 5px; } -.tbl-gridify td:first-child.dataTables_empty{ +.tbl-gridify td:first-child.dataTables_empty { background: none !important; } -.tbl-gridify td:first-child + td{ - padding-top:15px; +.tbl-gridify td:first-child + td { + padding-top: 15px; } -.tbl-gridify td:first-child a,.tbl-gridify td:first-child a:hover,.tbl-gridify td:first-child a:active,.tbl-gridify td:first-child a:focus,.tbl-gridify td:first-child a:visited{ - color:#333 !important; +.tbl-gridify td:first-child a, +.tbl-gridify td:first-child a:hover, +.tbl-gridify td:first-child a:active, +.tbl-gridify td:first-child a:focus, +.tbl-gridify td:first-child a:visited { + color: #333 !important; } .tbl-gridify td { - padding:0 15px 15px 15px; + padding: 0 15px 15px 15px; } diff --git a/assets/js/src/adminForm.js b/assets/js/src/adminForm.js index f9e1cadb2..01a9c7293 100644 --- a/assets/js/src/adminForm.js +++ b/assets/js/src/adminForm.js @@ -66,7 +66,7 @@ function resetNewAdminForm() { function getAdminCode() { if ($('#adminCode').val() == '') { return slugify( - $('#ennewAdminName').val() + '-' + $('#provinceSelect').val() + $('#ennewAdminName').val() + '-' + $('#provinceSelect').val(), ); } return $('#adminCode').val(); diff --git a/assets/js/src/codeForm.js b/assets/js/src/codeForm.js index 5a85f741e..617e5c689 100644 --- a/assets/js/src/codeForm.js +++ b/assets/js/src/codeForm.js @@ -89,12 +89,12 @@ function getCodeObject() { codeObject.releases[0].description.howItWorks = {}; if ($('#endescriptionhowItWorks').val()) { codeObject.releases[0].description.howItWorks.en = $( - '#endescriptionhowItWorks' + '#endescriptionhowItWorks', ).val(); } if ($('#frdescriptionhowItWorks').val()) { codeObject.releases[0].description.howItWorks.fr = $( - '#frdescriptionhowItWorks' + '#frdescriptionhowItWorks', ).val(); } } @@ -161,12 +161,12 @@ function submitFormAdminCodeForm() { let codeName = codeObject.releases[0].name.en; let adminName = slugify( - $('#ennewAdminName').val() + '-' + $('#provinceSelect').val() + $('#ennewAdminName').val() + '-' + $('#provinceSelect').val(), ); let fileWriter = new YamlWriter(USERNAME, REPO_NAME); let codeFile = `_data/code/${$('#orgLevel').val()}/${slugify( - $('#ennewAdminName').val() + '-' + $('#provinceSelect').val() + $('#ennewAdminName').val() + '-' + $('#provinceSelect').val(), )}.yml`; let adminFile = `_data/administrations/${getSelectedOrgType()}.yml`; @@ -185,7 +185,7 @@ function submitFormAdminCodeForm() { codeFile, codeObject, adminFile, - resultAdmin + resultAdmin, ); } else throw err; }) @@ -193,7 +193,7 @@ function submitFormAdminCodeForm() { let promises = getNewAdminPartnerPromise( codeObject.releases[0], fileWriter, - config + config, ); Promise.all(promises) .then(function () { @@ -217,7 +217,7 @@ function getConfigNewAdmin( codeFile, codeObject, adminFile, - resultAdmin + resultAdmin, ) { return { body: { @@ -287,7 +287,7 @@ function submitCodeForm() { let promises = getNewAdminPartnerPromise( codeObject.releases[0], fileWriter, - config + config, ); Promise.all(promises) .then(function () { @@ -388,7 +388,7 @@ function selectAdmin() { release.name[lang] + '">' + release.name[lang] + - '' + '', ).appendTo('#nameselect'); }); $('#nameselect').prop('disabled', false).parent().removeClass('hide'); diff --git a/assets/js/src/custom-form-validation.js b/assets/js/src/custom-form-validation.js index 0d6b58419..62be428e4 100644 --- a/assets/js/src/custom-form-validation.js +++ b/assets/js/src/custom-form-validation.js @@ -47,7 +47,7 @@ $(document).on('wb-ready.wb', function () { } return true; }, - jQuery.validator.format(lettersSpaceError[lang]) + jQuery.validator.format(lettersSpaceError[lang]), ); /** @@ -65,7 +65,7 @@ $(document).on('wb-ready.wb', function () { } return true; }, - jQuery.validator.format(lettersSpaceError[lang]) + jQuery.validator.format(lettersSpaceError[lang]), ); /** @@ -83,7 +83,7 @@ $(document).on('wb-ready.wb', function () { } return true; }, - jQuery.validator.format(alphanumericSpaceError[lang]) + jQuery.validator.format(alphanumericSpaceError[lang]), ); /** @@ -101,7 +101,7 @@ $(document).on('wb-ready.wb', function () { } return true; }, - jQuery.validator.format(namesError[lang]) + jQuery.validator.format(namesError[lang]), ); /** @@ -119,7 +119,7 @@ $(document).on('wb-ready.wb', function () { } return true; }, - jQuery.validator.format(phoneError[lang]) + jQuery.validator.format(phoneError[lang]), ); /** @@ -137,7 +137,7 @@ $(document).on('wb-ready.wb', function () { } return true; }, - jQuery.validator.format(uniqNewAdminError[lang]) + jQuery.validator.format(uniqNewAdminError[lang]), ); jQuery.validator.addMethod( @@ -160,7 +160,7 @@ $(document).on('wb-ready.wb', function () { } return valid; }, - jQuery.validator.format(emailSuffixError[lang]) + jQuery.validator.format(emailSuffixError[lang]), ); } }); diff --git a/assets/js/src/designForm.js b/assets/js/src/designForm.js index c3ab3e6f6..201802565 100644 --- a/assets/js/src/designForm.js +++ b/assets/js/src/designForm.js @@ -137,12 +137,12 @@ function getDesignObject() { } if ($('#endescriptionhowItWorks').val()) { designObject.description.howItWorks.en = $( - '#endescriptionhowItWorks' + '#endescriptionhowItWorks', ).val(); } if ($('#frdescriptionhowItWorks').val()) { designObject.description.howItWorks.fr = $( - '#frdescriptionhowItWorks' + '#frdescriptionhowItWorks', ).val(); } @@ -165,7 +165,7 @@ function submitDesignFormNewAdmin() { let adminObject = getAdminObject(); let designName = $('#enname').val(); let adminName = slugify( - $('#ennewAdminName').val() + '-' + $('#provinceSelect').val() + $('#ennewAdminName').val() + '-' + $('#provinceSelect').val(), ); let fileWriter = new YamlWriter(USERNAME, REPO_NAME); @@ -186,8 +186,8 @@ function submitDesignFormNewAdmin() { designFile, adminFile, designResult, - adminResult - ) + adminResult, + ), ); }) .catch((err) => { @@ -200,8 +200,8 @@ function submitDesignFormNewAdmin() { designFile, adminFile, designObject, - adminResult - ) + adminResult, + ), ); } else throw err; }) @@ -221,7 +221,7 @@ function getConfigUpdateDesignNewAdmin( designFile, adminFile, designResult, - adminObject + adminObject, ) { return { body: JSON.stringify({ @@ -260,7 +260,7 @@ function getConfigNewDesignNewAdmin( designFile, adminFile, designObject, - adminObject + adminObject, ) { return { body: JSON.stringify({ diff --git a/assets/js/src/designType.js b/assets/js/src/designType.js index 668c271d2..e6a5afa17 100644 --- a/assets/js/src/designType.js +++ b/assets/js/src/designType.js @@ -11,7 +11,7 @@ $(document).ready(function () { let length = $('#addMoredesignType ul li').length; let index = length == 1 ? '' : length - 1; $('#newType' + index).addClass('hide'); - } + }, ); $('#addMoredesignType').on('click', '.newTypeButton button', function () { let index = getmoreIndex($(this)); @@ -29,7 +29,7 @@ $(document).ready(function () { let index = getmoreIndex($(this)); hideType(index); resetType(index); - } + }, ); $('#addMoredesignType').on('change', '.designTypeSelect select', function () { let index = getmoreIndex($(this)); diff --git a/assets/js/src/git-file-manager.js b/assets/js/src/git-file-manager.js index 34e47e405..f0a31dc94 100644 --- a/assets/js/src/git-file-manager.js +++ b/assets/js/src/git-file-manager.js @@ -94,7 +94,7 @@ class YamlWriter extends FileWriter { result = this.mergeFirstLevel( DeepObject.get(result), newObject, - propPath + propPath, ); // Update the object if there's a match. diff --git a/assets/js/src/more-group.js b/assets/js/src/more-group.js index a8118380b..5b3d1dc8a 100644 --- a/assets/js/src/more-group.js +++ b/assets/js/src/more-group.js @@ -64,11 +64,11 @@ function resetMoreGroup(group) { function addBtns(obj) { $( - '' + '', ).appendTo(obj); $( - '' + '', ).appendTo(obj); } diff --git a/assets/js/src/partners.js b/assets/js/src/partners.js index 40158699d..abc0f3b08 100644 --- a/assets/js/src/partners.js +++ b/assets/js/src/partners.js @@ -9,7 +9,7 @@ $(document).ready(function () { let length = $('#addMorepartners ul li').length; let index = length == 1 ? '' : length - 1; $('#partnersNewAdmin' + index).addClass('hide'); - } + }, ); hideFieldsPartner(''); @@ -18,7 +18,7 @@ $(document).ready(function () { '.partnersAdminCodeSelect select', function () { selectPartners(this); - } + }, ); $('#addMorepartners').on( 'click', @@ -31,7 +31,7 @@ $(document).ready(function () { } else { $('#partnersNewAdmin' + index).removeClass('hide'); } - } + }, ); $('#addMorepartners').on( 'click', @@ -40,7 +40,7 @@ $(document).ready(function () { removeNewPartner(this); let index = getmoreIndex($(this)); $('#partnersNewAdmin' + index).addClass('hide'); - } + }, ); $('#addMorepartners').on('change', '.orgLevelPartner select', function () { let index = getmoreIndex($(this)); @@ -63,7 +63,7 @@ function getAdminCodePartner(index) { $('#enpartnersname' + index).val() + ($('#provinceSelectPartner' + index).val() !== '' ? '-' + $('#provinceSelectPartner' + index).val() - : '') + : ''), ); } @@ -97,7 +97,7 @@ function addMorePartners(obj) { let first = suffix; if (suffix != '') { let suffixes = $( - 'input[data-for="partners-suffixes' + id + '"][type="text"]' + 'input[data-for="partners-suffixes' + id + '"][type="text"]', ).toArray(); for (let item in suffixes) { let val = suffixes[item].value; @@ -131,7 +131,7 @@ function getNewAdminPartnerPromise(obj, fileWriter, config) { `_data/administrations/${orgLevel}.yml`, newAdmins[orgLevel], '', - 'code' + 'code', ) .then((result) => { config.body.files[config.body.files.length] = { @@ -162,7 +162,7 @@ function getNewAdminPartnerObject(index) { let suffix = $('#partnerssuffix').val(); if (suffix != '') { let suffixes = $( - 'input[data-for="partners-suffixes' + index + '"][type="text"]' + 'input[data-for="partners-suffixes' + index + '"][type="text"]', ).toArray(); for (let item in suffixes) { suffix += ',' + suffixes[item].value; diff --git a/assets/js/src/partnershipForm.js b/assets/js/src/partnershipForm.js index 09e62b882..79f672005 100644 --- a/assets/js/src/partnershipForm.js +++ b/assets/js/src/partnershipForm.js @@ -81,12 +81,12 @@ function getPartnershipObject() { partnershipObject.projects[0].description.howItWorks = {}; if ($('#endescriptionhowItWorks').val()) { partnershipObject.projects[0].description.howItWorks.en = $( - '#endescriptionhowItWorks' + '#endescriptionhowItWorks', ).val(); } if ($('#frdescriptionhowItWorks').val()) { partnershipObject.projects[0].description.howItWorks.fr = $( - '#frdescriptionhowItWorks' + '#frdescriptionhowItWorks', ).val(); } } @@ -146,7 +146,7 @@ function submitForm() { partnershipName, adminName, partnershipFile, - resultPartnership + resultPartnership, ); }) .catch((err) => { @@ -156,7 +156,7 @@ function submitForm() { partnershipName, adminName, partnershipFile, - partnershipObject + partnershipObject, ); else throw err; }) @@ -172,16 +172,16 @@ function submitForm() { adminName, adminCode, adminFile, - resultAdmin + resultAdmin, ); - }) + }), ); } Promise.all(adminPromise).then(function () { let newAdminPartnerPromise = getNewAdminPartnerPromise( partnershipObject.projects[0], fileWriter, - config + config, ); Promise.all(newAdminPartnerPromise) .then(function () { @@ -271,7 +271,7 @@ function selectAdmin() { project.name[lang] + '">' + project.name[lang] + - '' + '', ).appendTo('#nameselect'); }); $('#nameselect').prop('disabled', false).parent().removeClass('hide'); diff --git a/assets/js/src/programmingLanguages.js b/assets/js/src/programmingLanguages.js index 2f6024e63..04ec5688f 100644 --- a/assets/js/src/programmingLanguages.js +++ b/assets/js/src/programmingLanguages.js @@ -5,8 +5,8 @@ function addMoreLanguages(value) { + value != undefined ? ' value="' + value + '"' : '' + }>
@@ -15,7 +15,7 @@ function addMoreLanguages(value) { function getLanguages() { return $( - 'input[data-for="languages"]:checked, input[data-for="languages"][type="text"]' + 'input[data-for="languages"]:checked, input[data-for="languages"][type="text"]', ) .toArray() .map((input) => input.value); diff --git a/assets/js/src/softwareForm.js b/assets/js/src/softwareForm.js index c72c6fdb4..a92ba2e49 100644 --- a/assets/js/src/softwareForm.js +++ b/assets/js/src/softwareForm.js @@ -129,12 +129,12 @@ function getsoftwareObject() { } if ($('#endescriptionhowItWorks').val()) { softwareObject.description.howItWorks.en = $( - '#endescriptionhowItWorks' + '#endescriptionhowItWorks', ).val(); } if ($('#frdescriptionhowItWorks').val()) { softwareObject.description.howItWorks.fr = $( - '#frdescriptionhowItWorks' + '#frdescriptionhowItWorks', ).val(); } @@ -157,7 +157,7 @@ function submitSoftwareFormNewAdmin() { let adminObject = getAdminObject(); let softwareName = $('#enname').val(); let adminName = slugify( - $('#ennewAdminName').val() + '-' + $('#provinceSelect').val() + $('#ennewAdminName').val() + '-' + $('#provinceSelect').val(), ); let fileWriter = new YamlWriter(USERNAME, REPO_NAME); @@ -178,8 +178,8 @@ function submitSoftwareFormNewAdmin() { softwareFile, adminFile, softwareResult, - adminResult - ) + adminResult, + ), ); }) .catch((err) => { @@ -192,8 +192,8 @@ function submitSoftwareFormNewAdmin() { softwareFile, adminFile, softwareObject, - adminResult - ) + adminResult, + ), ); } else throw err; }) @@ -213,7 +213,7 @@ function getConfigUpdateSoftwareNewAdmin( softwareFile, adminFile, softwareResult, - adminObject + adminObject, ) { return { body: JSON.stringify({ @@ -252,7 +252,7 @@ function getConfigNewSoftwareNewAdmin( softwareFile, adminFile, softwareObject, - adminObject + adminObject, ) { return { body: JSON.stringify({ @@ -305,7 +305,7 @@ function submitFormSoftware() { if (err.status == 404) { return fetch( PRBOT_URL, - getConfigNew(softwareObject, file, ProjectName) + getConfigNew(softwareObject, file, ProjectName), ); } else throw err; }) diff --git a/assets/js/src/standardForm.js b/assets/js/src/standardForm.js index a75ef5c28..0f5074868 100644 --- a/assets/js/src/standardForm.js +++ b/assets/js/src/standardForm.js @@ -191,11 +191,11 @@ function getStandardObject() { standardObject.description.howItWorks = {}; if ($('#endescriptionhowItWorks').val()) standardObject.description.howItWorks.en = $( - '#endescriptionhowItWorks' + '#endescriptionhowItWorks', ).val(); if ($('#frdescriptionhowItWorks').val()) standardObject.description.howItWorks.fr = $( - '#frdescriptionhowItWorks' + '#frdescriptionhowItWorks', ).val(); } return standardObject; @@ -216,7 +216,7 @@ function submitStandardForm() { .then((result) => { return fetch( PRBOT_URL, - getConfigUpdate(result, file, standardObject.standardAcronym) + getConfigUpdate(result, file, standardObject.standardAcronym), ); }) .catch((err) => { @@ -290,7 +290,7 @@ function submitStandardFormNewAdmin() { let standardName = standardObject.standardAcronym.toLowerCase(); let adminName = slugify( - $('#ennewAdminName').val() + '-' + $('#provinceSelect').val() + $('#ennewAdminName').val() + '-' + $('#provinceSelect').val(), ); let fileWriter = new YamlWriter(USERNAME, REPO_NAME); @@ -311,8 +311,8 @@ function submitStandardFormNewAdmin() { standardFile, adminFile, standardResult, - adminResult - ) + adminResult, + ), ); }) .catch((err) => { @@ -325,8 +325,8 @@ function submitStandardFormNewAdmin() { standardFile, adminFile, standardObject, - adminResult - ) + adminResult, + ), ); } else throw err; }) @@ -350,7 +350,7 @@ function getConfigUpdateStandardNewAdmin( standardFile, adminFile, standardResult, - adminObject + adminObject, ) { return { body: JSON.stringify({ @@ -389,7 +389,7 @@ function getConfigNewStandardNewAdmin( standardFile, adminFile, standardObject, - adminObject + adminObject, ) { return { body: JSON.stringify({ diff --git a/assets/style.css b/assets/style.css index 1a783e7ea..7e03e2c53 100644 --- a/assets/style.css +++ b/assets/style.css @@ -1,16 +1,16 @@ -.panel-design{ +.panel-design { color: inherit !important; - text-decoration: none !important + text-decoration: none !important; } -.font-size-50{ - font-size: 50px +.font-size-50 { + font-size: 50px; } .hiddenText { - height: 1px; - width: 1px; - position: absolute; - overflow: hidden; - top: -10px; + height: 1px; + width: 1px; + position: absolute; + overflow: hidden; + top: -10px; } diff --git a/cypress.json b/cypress.json index 5e0725b20..60ed5aa53 100644 --- a/cypress.json +++ b/cypress.json @@ -1,3 +1,3 @@ { - "video": false -} \ No newline at end of file + "video": false +} diff --git a/cypress/fixtures/example.json b/cypress/fixtures/example.json index da18d9352..02e425437 100644 --- a/cypress/fixtures/example.json +++ b/cypress/fixtures/example.json @@ -2,4 +2,4 @@ "name": "Using fixtures to represent data", "email": "hello@cypress.io", "body": "Fixtures are a great way to mock data for responses to routes" -} \ No newline at end of file +} diff --git a/package-lock.json b/package-lock.json index e0e2e4149..bdf842dc6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "globals": "^15.4.0", "licensee": "^10.0.0", "markdownlint-cli2": "^0.13.0", - "prettier": "^2.7.1", + "prettier": "^3.3.1", "vnu-jar": "^23.4.11" } }, @@ -4021,15 +4021,15 @@ } }, "node_modules/prettier": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", - "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.1.tgz", + "integrity": "sha512-7CAwy5dRsxs8PHXT3twixW9/OEll8MLE0VRPCJyl7CkS6VHGPSlsVaWTiASPTyGyYRyApxlaWTzwUxVNrhcwDg==", "dev": true, "bin": { - "prettier": "bin-prettier.js" + "prettier": "bin/prettier.cjs" }, "engines": { - "node": ">=10.13.0" + "node": ">=14" }, "funding": { "url": "https://github.com/prettier/prettier?sponsor=1" diff --git a/package.json b/package.json index e337053a0..36f1c5f1a 100644 --- a/package.json +++ b/package.json @@ -8,10 +8,10 @@ "cypress:run": "cypress run", "lint": "npm run lint:js && npm run lint:html", "lint:html": "java -jar node_modules/vnu-jar/build/dist/vnu.jar --errors-only --no-langdetect --skip-non-html _site/", - "lint:js": "eslint .", + "lint:js": "eslint . && prettier -c \"**/*.js\" \"**/*.mjs\"", "lint:md": "markdownlint-cli2 \"**/*.md\"", "open-licences": "licensee --errors-only", - "prettify": "eslint . --fix", + "prettify": "eslint . --fix && prettier -w .", "test": "npm run lint && npm run open-licences" }, "repository": { @@ -37,7 +37,7 @@ "globals": "^15.4.0", "licensee": "^10.0.0", "markdownlint-cli2": "^0.13.0", - "prettier": "^2.7.1", + "prettier": "^3.3.1", "vnu-jar": "^23.4.11" } }