diff --git a/.eslintrc.json b/.eslintrc.json
index 22d950e57..4ce112962 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -2,40 +2,49 @@
"env": {
"browser": true,
"node": true,
- "es2021": true,
- "jest/globals": true
+ "es2021": true
},
"extends": [
"eslint:recommended",
- "plugin:react/recommended"
- //"plugin:prettier/recommended"
+ "plugin:react/recommended",
+ "plugin:react-hooks/recommended",
+ "plugin:jsx-a11y/recommended",
+ "plugin:prettier/recommended"
],
- "globals": {
- "process": true
- },
"overrides": [
{
- "files": ["test/**"],
- "plugins": ["jest"],
+ "files": ["**/*test.js"],
"extends": [
"eslint:recommended",
- "plugin:jest/recommended"
- //"plugin:prettier/recommended"
+ "plugin:jest/recommended",
+ "plugin:prettier/recommended"
],
- "rules": { "jest/prefer-expect-assertions": "off" }
+ "rules": { "jest/prefer-expect-assertions": "off" },
+ "env": {
+ "jest": true
+ }
}
],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
- "plugins": ["react", "react-hooks", "jest", "jsx-a11y"],
"rules": {
// suppress errors for missing 'import React' in files
"react/react-in-jsx-scope": "off",
- "react/prop-types": "off"
+ "react/prop-types": "off",
+ // suppress currently failing recommended rules
+ "jsx-a11y/alt-text": "off",
+ "jsx-a11y/anchor-is-valid": "off",
+ "jsx-a11y/click-events-have-key-events": "off",
+ "jsx-a11y/iframe-has-title": "off",
+ "jsx-a11y/mouse-events-have-key-events": "off",
+ "jsx-a11y/no-autofocus": "off",
+ "jsx-a11y/no-noninteractive-element-interactions": "off",
+ "jsx-a11y/no-static-element-interactions": "off",
+ "react-hooks/exhaustive-deps": "off",
+ "react-hooks/rules-of-hooks": "off"
},
- "ignorePatterns": ["**/*.css", "**/*.scss"],
"settings": {
"react": {
"pragma": "React", // Pragma to use, default to "React"
diff --git a/package.json b/package.json
index 056687620..498ea2610 100644
--- a/package.json
+++ b/package.json
@@ -61,12 +61,6 @@
"fix": "eslint --fix --ext js,jsx . && prettier -w .",
"lint": "eslint --ext js,jsx . && prettier -c ."
},
- "eslintConfig": {
- "extends": [
- "react-app",
- "react-app/jest"
- ]
- },
"browserslist": {
"production": [
">0.2%",
diff --git a/src/__tests__/Buttons.test.js b/src/__tests__/Buttons.test.js
index 5733858a1..99f8dc724 100644
--- a/src/__tests__/Buttons.test.js
+++ b/src/__tests__/Buttons.test.js
@@ -12,7 +12,7 @@ jest.mock("react-router-dom", () => ({
}));
describe("Test button types", () => {
- test("Test that Button renders and fires onClick properly", () => {
+ test("that Button renders and fires onClick properly", () => {
const mockOnClick = jest.fn();
const testButton = ;
@@ -22,7 +22,7 @@ describe("Test button types", () => {
fireEvent.click(getByText("Test Button"));
expect(mockOnClick).toHaveBeenCalledTimes(1);
});
- test("Test that LinkButton renders properly and properly navigates to internal link", () => {
+ test("that LinkButton renders properly and properly navigates to internal link", () => {
const testButton = ;
const { getByText } = render(testButton);
diff --git a/src/__tests__/Dialogs.test.js b/src/__tests__/Dialogs.test.js
index 19a488203..2be4f471c 100644
--- a/src/__tests__/Dialogs.test.js
+++ b/src/__tests__/Dialogs.test.js
@@ -18,7 +18,7 @@ jest.mock("react-router-dom", () => {
});
describe("Test cookie consent pop-up", () => {
- test("Test that pop-up appears without cookie existing", async () => {
+ test("that pop-up appears without cookie existing", async () => {
// Launch CookieConsent
const { getByText } = render();
@@ -31,7 +31,7 @@ describe("Test cookie consent pop-up", () => {
});
});
- test("Test that pop-up does not appear if cookies have been accepted", async () => {
+ test("that pop-up does not appear if cookies have been accepted", async () => {
// Mock cookie that matches desired
Object.defineProperty(window.document, "cookie", {
configurable: true,
@@ -56,7 +56,7 @@ describe("Test cookie consent pop-up", () => {
});
});
describe("Test PoliciesModelledPopup", () => {
- test("Test that pop-up appears after beginning calculations", () => {
+ test("that pop-up appears after beginning calculations", () => {
const testProps = {
policy: {
reform: {