Skip to content

Commit

Permalink
Bump prettier from 2.8.8 to 3.0.0 (#8088)
Browse files Browse the repository at this point in the history
* Bump prettier from 2.8.8 to 3.0.0

Bumps [prettier](https://github.com/prettier/prettier) from 2.8.8 to 3.0.0.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](prettier/prettier@2.8.8...3.0.0)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Apply code formatting as per new prettier 3.0.0 defaults

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alejandro Celaya <alejandro.celaya@hypothes.is>
  • Loading branch information
dependabot[bot] and acelaya committed Aug 1, 2023
1 parent 336a444 commit b5ab715
Show file tree
Hide file tree
Showing 29 changed files with 156 additions and 154 deletions.
14 changes: 7 additions & 7 deletions gulpfile.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ gulp.task('build-css', () =>
'./h/static/styles/help-page.scss',
'./h/static/styles/site.scss',
'./h/static/styles/vendor/icomoon.css',
])
]),
);

gulp.task('watch-css', () => {
gulp.watch(
'h/static/styles/**/*.scss',
{ ignoreInitial: false },
gulp.series('build-css')
gulp.series('build-css'),
);
});

Expand Down Expand Up @@ -80,7 +80,7 @@ gulp.task('watch-images', () => {
const MANIFEST_SOURCE_FILES = 'build/@(fonts|images|scripts|styles)/**/*.*';

gulp.task('build-manifest', () =>
generateManifest({ pattern: MANIFEST_SOURCE_FILES })
generateManifest({ pattern: MANIFEST_SOURCE_FILES }),
);
gulp.task('watch-manifest', () => {
gulp.watch(MANIFEST_SOURCE_FILES, gulp.series('build-manifest'));
Expand All @@ -90,8 +90,8 @@ gulp.task(
'build',
gulp.series(
gulp.parallel(['build-js', 'build-css', 'build-fonts', 'build-images']),
'build-manifest'
)
'build-manifest',
),
);
gulp.task(
'watch',
Expand All @@ -101,7 +101,7 @@ gulp.task(
'watch-fonts',
'watch-images',
'watch-manifest',
])
]),
);

gulp.task('test', () =>
Expand All @@ -110,5 +110,5 @@ gulp.task('test', () =>
karmaConfig: './h/static/scripts/karma.config.js',
rollupConfig: './rollup-tests.config.mjs',
testsPattern: 'h/static/scripts/**/*-test.js',
})
}),
);
2 changes: 1 addition & 1 deletion h/static/scripts/admin-site.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const controllers = Object.assign(
{
'.js-users-delete-form': AdminUsersController,
},
sharedControllers
sharedControllers,
);
upgradeElements(document.body, controllers);
window.envFlags.ready();
2 changes: 1 addition & 1 deletion h/static/scripts/base/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class Controller {
constructor(element, options = {}) {
if (!element) {
throw new Error(
'Controllers require an element passed to the constructor'
'Controllers require an element passed to the constructor',
);
} else if (!element.controllers) {
element.controllers = [this];
Expand Down
2 changes: 1 addition & 1 deletion h/static/scripts/base/environment-flags.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export class EnvironmentFlags {

// Process flag overrides specified in URL
const flags = envFlagsFromUrl(
url || this._element.ownerDocument.location.href
url || this._element.ownerDocument.location.href,
);
flags.forEach(flag => {
if (flag.indexOf('no-') === 0) {
Expand Down
2 changes: 1 addition & 1 deletion h/static/scripts/base/upgrade-elements.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export function upgradeElements(root, controllers) {
el,
ControllerClass,
':',
err.toString()
err.toString(),
);

// Re-raise error so that Raven can capture and report it
Expand Down
2 changes: 1 addition & 1 deletion h/static/scripts/controllers/admin-users-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export class AdminUsersController extends Controller {
const window_ = options.window || window;
function confirmFormSubmit() {
return window_.confirm(
"This will permanently delete all the user's data. Are you sure?"
"This will permanently delete all the user's data. Are you sure?",
);
}

Expand Down
2 changes: 1 addition & 1 deletion h/static/scripts/controllers/authorize-form-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class AuthorizeFormController extends Controller {
type: 'authorization_canceled',
state,
},
'*'
'*',
);
}
}
Expand Down
20 changes: 10 additions & 10 deletions h/static/scripts/controllers/autosuggest-dropdown-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,19 @@ export class AutosuggestDropdownController extends Controller {

if (!configOptions.renderListItem) {
throw new Error(
'Missing renderListItem callback in AutosuggestDropdownController constructor'
'Missing renderListItem callback in AutosuggestDropdownController constructor',
);
}

if (!configOptions.listFilter) {
throw new Error(
'Missing listFilter function in AutosuggestDropdownController constructor'
'Missing listFilter function in AutosuggestDropdownController constructor',
);
}

if (!configOptions.onSelect) {
throw new Error(
'Missing onSelect callback in AutosuggestDropdownController constructor'
'Missing onSelect callback in AutosuggestDropdownController constructor',
);
}

Expand Down Expand Up @@ -118,7 +118,7 @@ export class AutosuggestDropdownController extends Controller {

const listChanged = updateHelper.listIsDifferent(
newState.list,
prevState.list
prevState.list,
);

if (listChanged) {
Expand Down Expand Up @@ -270,7 +270,7 @@ export class AutosuggestDropdownController extends Controller {
*/
_getActiveListItemElement() {
return this._listContainer.querySelector(
'.' + this.options.classNames.activeItem
'.' + this.options.classNames.activeItem,
);
}

Expand Down Expand Up @@ -334,7 +334,7 @@ export class AutosuggestDropdownController extends Controller {
} else {
this._input.parentNode.insertBefore(
this._suggestionContainer,
this._input.nextSibling
this._input.nextSibling,
);
}
}
Expand All @@ -360,11 +360,11 @@ export class AutosuggestDropdownController extends Controller {
// But for now this binding has no real affect on small list perf
li.addEventListener(
'mouseenter',
this._toggleItemHoverState.bind(this, /*hovering*/ true)
this._toggleItemHoverState.bind(this, /*hovering*/ true),
);
li.addEventListener(
'mouseleave',
this._toggleItemHoverState.bind(this, /*hovering*/ false)
this._toggleItemHoverState.bind(this, /*hovering*/ false),
);
li.addEventListener('mousedown', event => {
// for situations like mobile, hovering might not be
Expand Down Expand Up @@ -440,7 +440,7 @@ export class AutosuggestDropdownController extends Controller {
// capture phase needed to beat any other listener that could
// stop propagation after inspecting input value
},
/*useCapturePhase*/ true
/*useCapturePhase*/ true,
);

this._input.addEventListener(
Expand All @@ -453,7 +453,7 @@ export class AutosuggestDropdownController extends Controller {
// capture phase needed to beat any other listener that could
// stop propagation after inspecting input value
},
/*useCapturePhase*/ true
/*useCapturePhase*/ true,
);

this._input.addEventListener('focus', () => {
Expand Down
2 changes: 1 addition & 1 deletion h/static/scripts/controllers/confirm-submit-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class ConfirmSubmitController extends Controller {
return;
}
},
/*capture*/ true
/*capture*/ true,
);
}
}
6 changes: 3 additions & 3 deletions h/static/scripts/controllers/dropdown-menu-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class DropdownMenuController extends Controller {
element.ownerDocument.removeEventListener(
'click',
handleClickOutside,
true /* capture */
true /* capture */,
);
}
};
Expand All @@ -39,7 +39,7 @@ export class DropdownMenuController extends Controller {
element.ownerDocument.addEventListener(
'click',
handleClickOutside,
true /* capture */
true /* capture */,
);
});
}
Expand All @@ -48,7 +48,7 @@ export class DropdownMenuController extends Controller {
setElementState(this.refs.dropdownMenuContent, { open: state.open });
this.refs.dropdownMenuToggle.setAttribute(
'aria-expanded',
state.open.toString()
state.open.toString(),
);
}
}
12 changes: 6 additions & 6 deletions h/static/scripts/controllers/form-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class FormController extends Controller {
input: parts.formInput,
label: parts.label,
};
}
},
);

this.on(
Expand All @@ -73,7 +73,7 @@ export class FormController extends Controller {
focusedField: field,
});
},
true /* capture - focus does not bubble */
true /* capture - focus does not bubble */,
);

this.on('change', event => {
Expand Down Expand Up @@ -138,7 +138,7 @@ export class FormController extends Controller {
if (state.editingFields.length === 1) {
state.editingFields[0].container.parentElement.insertBefore(
this.refs.formActions,
state.editingFields[0].container.nextSibling
state.editingFields[0].container.nextSibling,
);
}

Expand Down Expand Up @@ -231,7 +231,7 @@ export class FormController extends Controller {
// messages.
const newFormEl = this.options.reload(err.form);
const newFormCtrl = newFormEl.controllers.find(
ctrl => ctrl instanceof FormController
ctrl => ctrl instanceof FormController,
);

// Resume editing the field where validation failed
Expand Down Expand Up @@ -265,7 +265,7 @@ export class FormController extends Controller {
*/
_focusGroup() {
const fieldContainers = this.state.editingFields.map(
field => field.container
field => field.container,
);
if (fieldContainers.length === 0) {
return null;
Expand Down Expand Up @@ -294,7 +294,7 @@ export class FormController extends Controller {
}

return null;
}
},
);
}

Expand Down
16 changes: 8 additions & 8 deletions h/static/scripts/controllers/search-bar-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export class SearchBarController extends Controller {
// groupSuggestions are made available by the scoped template data.
// see search.html.jinja2 for definition
const groupSuggestionJSON = document.querySelector(
'.js-group-suggestions'
'.js-group-suggestions',
);
let groupSuggestions = [];

Expand All @@ -102,7 +102,7 @@ export class SearchBarController extends Controller {
} catch (e) {
console.error(
'Could not parse .js-group-suggestions JSON content',
e
e,
);
}
}
Expand Down Expand Up @@ -219,7 +219,7 @@ export class SearchBarController extends Controller {
/** Return the controllers for all of the displayed lozenges. */
const lozenges = () => {
const lozElements = Array.from(
this.element.querySelectorAll('.js-lozenge')
this.element.querySelectorAll('.js-lozenge'),
);
return lozElements.map(el => el.controllers[0]);
};
Expand Down Expand Up @@ -259,12 +259,12 @@ export class SearchBarController extends Controller {
if (currentLozenges.length > 0) {
this._lozengeContainer.insertBefore(
lozengeEl,
currentLozenges[currentLozenges.length - 1].nextSibling
currentLozenges[currentLozenges.length - 1].nextSibling,
);
} else {
this._lozengeContainer.insertBefore(
lozengeEl,
this._lozengeContainer.firstChild
this._lozengeContainer.firstChild,
);
}

Expand Down Expand Up @@ -295,7 +295,7 @@ export class SearchBarController extends Controller {
*/
const lozengifyInput = () => {
const { lozengeValues, incompleteInputValue } = getLozengeValues(
this._input.value
this._input.value,
);

lozengeValues.forEach(addLozenge);
Expand Down Expand Up @@ -335,11 +335,11 @@ export class SearchBarController extends Controller {

renderListItem: listItem => {
let itemContents = `<span class="search-bar__dropdown-menu-title"> ${escapeHtml(
listItem.title
listItem.title,
)} </span>`;
if (listItem.type === GROUP_TYPE && listItem.relationship) {
itemContents += `<span class="search-bar__dropdown-menu-relationship"> ${escapeHtml(
listItem.relationship
listItem.relationship,
)} </span>`;
}

Expand Down
2 changes: 1 addition & 1 deletion h/static/scripts/controllers/share-widget-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class ShareWidget {
target.href = target
.getAttribute(TARGET_HREF_ATTR)
.replace('{href}', encodeURI(config.url));
}
},
);

// scope access dialog
Expand Down
2 changes: 1 addition & 1 deletion h/static/scripts/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ window.envFlags.init();

// Set up the Google Analytics command queue if we have a tracking ID.
const gaTrackingId = document.querySelector(
'meta[name="google-analytics-tracking-id"]'
'meta[name="google-analytics-tracking-id"]',
);
if (gaTrackingId) {
/* eslint-disable */
Expand Down
2 changes: 1 addition & 1 deletion h/static/scripts/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const controllers = Object.assign(
'.js-search-bucket': SearchBucketController,
'.js-share-widget': ShareWidgetController,
},
sharedControllers
sharedControllers,
);

if (window.envFlags && window.envFlags.get('js-capable')) {
Expand Down
2 changes: 1 addition & 1 deletion h/static/scripts/tests/base/controller-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('Controller', () => {
},
{
open: true,
}
},
);
});
});
Expand Down
Loading

0 comments on commit b5ab715

Please sign in to comment.