Skip to content

Commit

Permalink
Bump eslint from 8.57.0 to 9.0.0 (#681)
Browse files Browse the repository at this point in the history
* Bump eslint from 8.57.0 to 9.0.0

Bumps [eslint](https://github.com/eslint/eslint) from 8.57.0 to 9.0.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](eslint/eslint@v8.57.0...v9.0.0)

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

Signed-off-by: dependabot[bot] <[email protected]>

* migrate to 9.0

* add config file

* try ignore glob matching

* just hard code the one file we're linting

* regen yarn lock after merge conflicts

* eslint ignore patterns be confusing

* make config module and remove unnecessary plugin

* add new config file

* lint touchpoints form too

* unexport touchpoints form

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Bob Zhao <[email protected]>
  • Loading branch information
dependabot[bot] and fzhao99 authored May 7, 2024
1 parent 60d1029 commit 185bb7e
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 146 deletions.
22 changes: 0 additions & 22 deletions .eslintrc.yml

This file was deleted.

40 changes: 12 additions & 28 deletions assets/js/touchpoints.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Form components are namespaced under 'fba' = 'Feedback Analytics'
"use strict";

function FBAform(d, N) {
function FBAform(d) {
return {
formId: "2a6e9509",
formComponent: function () {
Expand Down Expand Up @@ -81,8 +81,8 @@ function FBAform(d, N) {
);
}
var phoneElements = d.querySelectorAll("input[type='tel']");
for (var i = 0; i < phoneElements.length; i++) {
phoneElements[i].addEventListener(
for (var j = 0; j < phoneElements.length; j++) {
phoneElements[j].addEventListener(
"keyup",
this.handlePhoneInput.bind(this),
false,
Expand Down Expand Up @@ -169,21 +169,6 @@ function FBAform(d, N) {
}
e.srcElement.value = number;
},
handleEmailInput: function (e) {
var EmailRegex =
/^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;
var email = e.srcElement.value.trim();
if (email.length == 0) {
return;
}
result = EmailRegex.test(email);
if (!result) {
showWarning($(this), "Please enter a valid email address");
} else {
showValid($(this));
}
e.srcElement.value = number;
},
handleSubmitClick: function (e) {
e.preventDefault();
this.resetErrors();
Expand Down Expand Up @@ -292,7 +277,7 @@ function FBAform(d, N) {
delete questions[item.name];
} else {
var EmailRegex =
/^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;
/^([a-zA-Z0-9_.+-])+@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if (EmailRegex.test(item.value)) delete questions[item.name];
}
});
Expand Down Expand Up @@ -368,10 +353,10 @@ function FBAform(d, N) {
var elem = form.querySelector(".usa-form-group--error");
if (elem == null) return;
elem.setAttribute("class", "question");
var elem = form.querySelector("#input-error-message");
if (elem != null) elem.parentNode.removeChild(elem);
elem = form.querySelector("#input-error");
if (elem != null) elem.parentNode.removeChild(elem);
var newElem = form.querySelector("#input-error-message");
if (newElem != null) newElem.parentNode.removeChild(newElem);
newElem = form.querySelector("#input-error");
if (newElem != null) newElem.parentNode.removeChild(newElem);
},
textCounter: function (field, maxlimit) {
var countfield = field.parentNode.querySelector(".counter-msg");
Expand Down Expand Up @@ -440,7 +425,7 @@ function FBAform(d, N) {
successText: function () {
return "Thanks for your feedback!";
},
showFormSuccess: function (e) {
showFormSuccess: function () {
var formComponent = this.formComponent();
var formElement = this.formElement();
var alertElement = formComponent.querySelector(".fba-alert");
Expand Down Expand Up @@ -500,7 +485,6 @@ function FBAform(d, N) {
formSuccess: function (e) {
// Clear the alert box
var formComponent = this.formComponent();
var alertElement = formComponent.querySelector(".fba-alert");
var alertElementBody =
formComponent.getElementsByClassName("usa-alert__text")[0];
var alertErrorElement = formComponent.querySelector(".fba-alert-error");
Expand Down Expand Up @@ -530,7 +514,7 @@ function FBAform(d, N) {
var errors = jsonResponse.messages;

for (var err in errors) {
if (errors.hasOwnProperty(err)) {
if (Object.prototype.hasOwnProperty.call(errors, err)) {
alertErrorElementBody.innerHTML += err;
alertErrorElementBody.innerHTML += " ";
alertErrorElementBody.innerHTML += errors[err];
Expand Down Expand Up @@ -622,8 +606,8 @@ function FBAform(d, N) {
);
}

for (var i = 0; i < nextButtons.length; i++) {
nextButtons[i].addEventListener(
for (var k = 0; k < nextButtons.length; k++) {
nextButtons[k].addEventListener(
"click",
function (e) {
e.preventDefault();
Expand Down
23 changes: 23 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import globals from "globals";
import js from '@eslint/js';

export default [
{
files:["assets/**/*.js"],
languageOptions: {
ecmaVersion: 2020,
sourceType: "module",
globals: {
...globals.browser,
}
},
...js.configs.recommended
},
{
ignores: [
"**/uswds*.js",
"**/main.js",
"**/anchor*.js",
],
}
];
1 change: 0 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
USWDS SASS GULPFILE
----------------------------------------
*/

const autoprefixer = require("autoprefixer");
const csso = require("postcss-csso");
const uncss = require("postcss-uncss");
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"uswds-update": "npm update uswds",
"uncss": "gulp uncss",
"watch": "gulp watch",
"eslint": "eslint assets/js/",
"eslint": "eslint",
"build": "gulp build-sass && bundle exec jekyll build --config _config.yml",
"build:dev": "gulp build-sass && bundle exec jekyll build --config _config.yml,_dev_config.yml",
"build:dev2": "gulp build-sass && bundle exec jekyll build --config _config.yml,_dev2_config.yml",
Expand Down Expand Up @@ -57,8 +57,7 @@
"@uswds/compile": "^1.1.0",
"autoprefixer": "^10.4.19",
"del": "^6.0.0",
"eslint": "^8.57.0",
"eslint-plugin-frontmatter": "0.0.8",
"eslint": "^9.0.0",
"gulp": "^4.0.2",
"gulp-postcss": "^9.1.0",
"gulp-rename": "^2.0.0",
Expand Down
Loading

0 comments on commit 185bb7e

Please sign in to comment.