Skip to content

Commit

Permalink
Revert "Run prettier on JS"
Browse files Browse the repository at this point in the history
This reverts commit 21a1fa8.
  • Loading branch information
mejiaj committed Feb 21, 2025
1 parent 21a1fa8 commit 3463c1a
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 16 deletions.
4 changes: 3 additions & 1 deletion config/crawl.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ const runServer = require("./static-server");
// These pages incorporate content from other files in other repos, so
// they should be considered "second class" by the link checker, and
// only emit warnings on 404s rather than errors.
const WARNING_PAGES = ["/documentation/code-guidelines/"];
const WARNING_PAGES = [
"/documentation/code-guidelines/"
];
const WARNING = chalk.yellow("Warning");
const ERROR = chalk.red("Error");

Expand Down
8 changes: 4 additions & 4 deletions config/gulp/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const cleanAssets = gulp.parallel(
cleanImages,
cleanJavascript,
cleanStyles,
removeAssetsDir
removeAssetsDir,
);

function spawnP(cmd, args, opts) {
Expand Down Expand Up @@ -57,8 +57,8 @@ function buildUSWDSComponents() {
new Error(
`${gulpfile} does not exist! You need a newer version of USWDS; ` +
`specifically, one that includes the following PR: ` +
`https://github.com/uswds/uswds/pull/2050`
)
`https://github.com/uswds/uswds/pull/2050`,
),
);
}

Expand All @@ -68,7 +68,7 @@ function buildUSWDSComponents() {
* We need to: install USWDS deps and build components to HTML.
*/
return spawnP("npm", ["install"], sharedOpts).then(() =>
spawnP("npm", ["run", "build:html"], sharedOpts)
spawnP("npm", ["run", "build:html"], sharedOpts),
);
}
}
Expand Down
8 changes: 3 additions & 5 deletions config/gulp/images.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ var task = "images";
function copyDocImages() {
dutil.logMessage(task, "Copying images from img/");

var stream = gulp
.src("./img/**/*", {
encoding: false,
})
.pipe(gulp.dest("assets/img"));
var stream = gulp.src("./img/**/*", {
encoding: false,
}).pipe(gulp.dest("assets/img"));

return stream;
}
Expand Down
2 changes: 1 addition & 1 deletion config/gulp/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function build() {
.pipe(
rename({
basename: "styleguide",
})
}),
)
.pipe(sourcemaps.write("."))
.pipe(gulp.dest("assets/js"));
Expand Down
5 changes: 3 additions & 2 deletions js/copy-code.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ const createCopyButton = () => {
};

/**
* Creates a screen reader only div element for success text
*
* Creates a screen reader only div element for success text
*
* @return {HTMLDivElement} - A div for screen reader text
*/
const createSRStatus = () => {
Expand All @@ -69,6 +69,7 @@ const copyOnClick = (event) => {
const labelVisual = copyBtn.querySelector("[aria-hidden]");
const labelSR = btnWrapper.querySelector(SR_STATUS_MESSAGE);


// Set success state
copyBtn.classList.add(COPY_BUTTON_SUCCESS_CLASS);
labelVisual.textContent = "Copied!";
Expand Down
2 changes: 1 addition & 1 deletion js/scroll-to-top-for-hash.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var timeout;
* top of the section. This interrupts that and positions section
* title correctly.
*/
function scrollToTopForHash() {
function scrollToTopForHash () {
var hash = window.location.hash.substr(1);
var scrollTopPos = hash ? calculateAnchorPosition(hash) : 0;

Expand Down
2 changes: 1 addition & 1 deletion js/sidenav.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ $(".sidenav").on("keydown", "a", function (e) {

$(".sidenav").on("click", "a", function (e) {
// long url splitting
var hashLocation = $(this).attr("href").split("#")[1];
var hashLocation = $(this).attr("href").split("#")[ 1 ];
var scrollTopPos = calculateAnchorPosition(hashLocation);

//if anchor doesn't exist on the page, or calc fails
Expand Down
2 changes: 1 addition & 1 deletion js/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ require("./copy-code");
var stickyElements = document.getElementsByClassName("sticky");

for (var i = stickyElements.length - 1; i >= 0; i--) {
Stickyfill.add(stickyElements[i]);
Stickyfill.add(stickyElements[ i ]);
}

0 comments on commit 3463c1a

Please sign in to comment.