Skip to content

Commit

Permalink
fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mmmavis committed Mar 22, 2024
1 parent 2dced98 commit 441ca40
Show file tree
Hide file tree
Showing 71 changed files with 192 additions and 192 deletions.
6 changes: 3 additions & 3 deletions copy-db.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const APP = process.argv.includes(`--prod`) ? PROD_APP : STAGE_APP;

if (APP === STAGE_APP) {
console.log(
`Running db copy for staging, run with --prod to run for production`
`Running db copy for staging, run with --prod to run for production`,
);
}

Expand Down Expand Up @@ -100,7 +100,7 @@ postgres(`createdb ${DB_FLAGS} wagtail`);

console.log(`Building user roles...`);
[ROLE, `datastudio`, `datagrip-cade`].forEach((role) =>
postgres(`createuser ${DB_FLAGS} -s ${role}`, true)
postgres(`createuser ${DB_FLAGS} -s ${role}`, true),
);

console.log(`Importing database snapshot...`);
Expand All @@ -117,7 +117,7 @@ run(`inv createsuperuser`, true, silent);

console.log(`Migrating database to match current branch migrations...`);
run(
`docker exec ${IMAGE_NAMES.BACKEND} ./dockerpythonvenv/bin/python network-api/manage.py migrate`
`docker exec ${IMAGE_NAMES.BACKEND} ./dockerpythonvenv/bin/python network-api/manage.py migrate`,
);

console.log(`Stopping docker images...`);
Expand Down
8 changes: 4 additions & 4 deletions source/js/buyers-guide/analytics-events.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ function bindCheckboxCheckedGA(selector, eventData) {
ReactGA.event(eventData);
}
},
true
true,
);
}

Expand Down Expand Up @@ -156,7 +156,7 @@ function trackSearchBoxUsage() {

sessionStorage.setItem(SESSION_KEY, true);
},
true
true,
);
}

Expand All @@ -166,7 +166,7 @@ function trackSearchBoxUsage() {
function trackGoBackToAllProductsLink() {
const link = document.querySelector("body.catalog .go-back-to-all-link");
const searchBox = document.querySelector(
"body.catalog input#product-filter-search-input"
"body.catalog input#product-filter-search-input",
);

if (!(link && searchBox)) {
Expand All @@ -183,7 +183,7 @@ function trackGoBackToAllProductsLink() {
label: `All link tap for ${searchBox.value}`,
});
},
true
true,
);
}

Expand Down
2 changes: 1 addition & 1 deletion source/js/buyers-guide/bg-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ let main = {
initializeSentry(
env.SENTRY_DSN,
env.RELEASE_VERSION,
env.SENTRY_ENVIRONMENT
env.SENTRY_ENVIRONMENT,
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class CreepChart extends Component {
<tbody>
{this.state.creepinessData.map((data, index) => {
let percent = Math.round(
(100 * data.value) / this.state.totalCreepiness
(100 * data.value) / this.state.totalCreepiness,
);
let voteColumn =
this.props.userVoteGroup === index ? `your-vote` : ``;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ class Creepometer extends Component {
*/
render() {
let frameOffset = Math.round(
(this.state.percentage * (this.faceCount - 1)) / 100
(this.state.percentage * (this.faceCount - 1)) / 100,
);

let trackheadOpts = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ProductQuiz extends Component {
componentDidMount() {
this.setState({
numBad: this.state.selectedChoices.filter(
(choice) => choice.points === POINTS.bad
(choice) => choice.points === POINTS.bad,
).length,
score: this.state.selectedChoices.reduce((acc, choice) => {
return acc + choice.points;
Expand All @@ -41,7 +41,7 @@ class ProductQuiz extends Component {
this.setState({
// find out how many "bad" products are selected
numBad: this.state.selectedChoices.filter(
(choice) => choice.points === POINTS.bad
(choice) => choice.points === POINTS.bad,
).length,
// calculate the score
score: this.state.selectedChoices.reduce((acc, choice) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class ProductQuizShareButtons extends Component {
shareButtonClicked(event, shareProgressButtonId) {
if (shareProgressButtonId) {
const shareProgressButton = document.querySelector(
`#${shareProgressButtonId} a`
`#${shareProgressButtonId} a`,
);

if (shareProgressButton) {
Expand All @@ -81,18 +81,18 @@ class ProductQuizShareButtons extends Component {
<div className="circle share-button-group tw-justify-center tw-flex medium:tw-hidden">
<div className="subgroup">
{this.renderFacebookButton(
<span className="sr-only">Share on Facebook</span>
<span className="sr-only">Share on Facebook</span>,
)}
{this.renderTwitterButton(
<span className="sr-only">Share on Twitter</span>
<span className="sr-only">Share on Twitter</span>,
)}
</div>
<div className="subgroup tw-mr-0">
{this.renderEmailButton(
<span className="sr-only">Share by Email</span>
<span className="sr-only">Share by Email</span>,
)}
{this.renderCopyLinkButton(
<span className="sr-only">Copy to clipboard</span>
<span className="sr-only">Copy to clipboard</span>,
)}
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const SocialShareLink = (props) => {
srLabel = `Twitter`;
shareEvent.label += `to twitter`;
link = `https://twitter.com/intent/tweet?text=${encodeURIComponent(
shareText
shareText,
)}`;
}

Expand Down
16 changes: 8 additions & 8 deletions source/js/buyers-guide/homepage-c-slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default {
// Figure out which face to show while scrolling:
let dingFilter = !!document.querySelector(`body.show-ding-only`);
let visible = Array.from(products).filter((v) =>
isElementInViewport(v, dingFilter)
isElementInViewport(v, dingFilter),
);
let n = visible.length;

Expand All @@ -96,16 +96,16 @@ export default {
MINIMUM_HAPPINESS_RATING,
MAXIMUM_CREEPINESS_RATING,
0,
100
100,
),
1,
100
100,
);

// The averageCreepiness will be in range [1,100] so we can dec1 the
// valueto make sure we're in frame range [0,frames.length-1]:
let frame = Math.round(
((SPRITE_FRAME_COUNT - 1) * (mappedAverageCreepiness - 1)) / 100
((SPRITE_FRAME_COUNT - 1) * (mappedAverageCreepiness - 1)) / 100,
);

face.style.backgroundPositionY = `${-frame * EMOJI_FRAME_HEIGHT}px`;
Expand All @@ -120,19 +120,19 @@ export default {
} else {
let format = pgettext(
"Creepiness label followed by an exclamation mark",
"%(label)s!"
"%(label)s!",
);
bubbleText.textContent = interpolate(
format,
{ label: CREEPINESS_LABELS[bin] },
true
true,
);
bubble.classList.remove(`d-none`);
}
},
{
passive: true, // remember not to bog down the UI thread.
}
},
);

/**
Expand Down Expand Up @@ -196,7 +196,7 @@ export default {
},
{
passive: true, // remember not to bog down the UI thread.
}
},
);
}
},
Expand Down
4 changes: 2 additions & 2 deletions source/js/buyers-guide/inject-react/creep-vote.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ export default (apps, siteUrl) => {
votes={votes}
whenLoaded={() => resolve()}
joinUsApiUrl={`${siteUrl}/api/campaign/signups/0/`}
/>
/>,
);
})
}),
);
});
};
4 changes: 2 additions & 2 deletions source/js/buyers-guide/inject-react/product-quiz.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ export default (apps, siteUrl) => {
whenLoaded={() => resolve()}
joinUsApiUrl={`${siteUrl}/api/campaign/signups/0/`}
pniHomeUrl={`${siteUrl}/privacynotincluded/`}
/>
/>,
);
})
}),
);
});
};
6 changes: 3 additions & 3 deletions source/js/buyers-guide/newsletter-box.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
const NewsletterBox = {
toggleVisibilityClasses: () => {
const buyersGuideNewsletterBox = document.querySelectorAll(
".buyersguide-newsletter-box"
".buyersguide-newsletter-box",
);
// Used for toggle visibility for buyersguide newsletter container
if (buyersGuideNewsletterBox.length > 0) {
buyersGuideNewsletterBox.forEach((box) =>
box.classList.remove("tw-hidden")
box.classList.remove("tw-hidden"),
);
}

// Used for buyersguide product review grid toggle visibility
const buyersGuideGridContainer = document.querySelector(
"#product-grid-newsletter-signup"
"#product-grid-newsletter-signup",
);
if (buyersGuideGridContainer) {
buyersGuideGridContainer.classList.add("tw-flex");
Expand Down
2 changes: 1 addition & 1 deletion source/js/buyers-guide/product-tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function setHighlight(target) {
button.classList.remove(
"tw-bg-white",
"tw-text-black",
"hover:tw-text-blue-80"
"hover:tw-text-blue-80",
);
button.classList.add("tw-bg-black", "tw-text-white");
button.setAttribute("aria-selected", "true");
Expand Down
14 changes: 7 additions & 7 deletions source/js/buyers-guide/search/history.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@ export function setupHistoryManagement(
searchBar,
searchInput,
mobileSearchBar,
mobileSearchInput
mobileSearchInput,
) {
setupPopStateHandler(
instance,
searchBar,
searchInput,
mobileSearchBar,
mobileSearchInput
mobileSearchInput,
);
performInitialHistoryReplace(
instance,
searchBar,
searchInput,
mobileSearchBar,
mobileSearchInput
mobileSearchInput,
);
}

Expand All @@ -45,7 +45,7 @@ export function performInitialHistoryReplace(
searchBar,
searchInput,
mobileSearchBar,
mobileSearchInput
mobileSearchInput,
) {
history.replaceState(
{
Expand All @@ -57,7 +57,7 @@ export function performInitialHistoryReplace(
sort: history.state?.sort ?? "ASCENDING",
},
Utils.getTitle(categoryTitle.value.trim()),
location.href
location.href,
);

if (history.state?.search) {
Expand Down Expand Up @@ -86,7 +86,7 @@ export function performInitialHistoryReplace(
sort: history.state?.sort,
},
Utils.getTitle(categoryTitle.value.trim()),
location.href
location.href,
);

searchBar.classList.add(`has-content`);
Expand Down Expand Up @@ -130,7 +130,7 @@ export function setupPopStateHandler(
searchBar,
searchInput,
mobileSearchBar,
mobileSearchInput
mobileSearchInput,
) {
window.addEventListener(`popstate`, (event) => {
const { state } = event;
Expand Down
14 changes: 7 additions & 7 deletions source/js/buyers-guide/search/member-functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const subcategories = document.querySelectorAll(`.subcategories`);
*/
export function setupNavLinks(instance) {
const navLinks = document.querySelectorAll(
`#multipage-nav a,.category-header,#pni-nav-mobile a`
`#multipage-nav a,.category-header,#pni-nav-mobile a`,
);

for (const nav of navLinks) {
Expand Down Expand Up @@ -45,7 +45,7 @@ export function setupNavLinks(instance) {
sort: history.state?.sort,
},
Utils.getTitle(categoryName),
evt.target.href
evt.target.href,
);

document.title = Utils.getTitle(categoryName);
Expand Down Expand Up @@ -84,7 +84,7 @@ export function setupNavLinks(instance) {
categoryTitle.value = evt.target.dataset.parent;
parentTitle.value = "";
href = document.querySelector(
`#multipage-nav a[data-name="${evt.target.dataset.parent}"],.category-header`
`#multipage-nav a[data-name="${evt.target.dataset.parent}"],.category-header`,
).href;
instance.toggleSubcategory(true);
}
Expand All @@ -99,18 +99,18 @@ export function setupNavLinks(instance) {
sort: history.state?.sort,
},
Utils.getTitle(subcategoryName),
href
href,
);

document.title = Utils.getTitle(categoryTitle.value.trim());
Utils.updateHeader(
categoryTitle.value.trim(),
parentTitle.value.trim()
parentTitle.value.trim(),
);
instance.filterCategory(categoryTitle.value.trim());
}
},
true
true,
);
}
}
Expand Down Expand Up @@ -142,7 +142,7 @@ export function setupGoBackToAll(instance) {
sort: history.state?.sort,
},
Utils.getTitle(evt.target.dataset.name),
evt.target.href
evt.target.href,
);

Utils.setActiveCatNavLink("None");
Expand Down
Loading

0 comments on commit 441ca40

Please sign in to comment.