Skip to content

A local-first personal finance app

chore: fix eslint issues and make warnings CI blocking

Matiss Janis Aboltinsd2b210088f57
diff --git a/.eslintrc.js b/.eslintrc.js
index 6c47a52cc6..4597913cd8 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -3,7 +3,6 @@ module.exports = {
extends: ['react-app'],
rules: {
'prettier/prettier': 'error',
- 'no-unused-vars': 'off',
'no-loop-func': 'off',
'no-restricted-globals': 'off',
diff --git a/package.json b/package.json
index 71519ac861..1dcd496822 100644
--- a/package.json
+++ b/package.json
@@ -29,7 +29,7 @@
"test:debug": "yarn workspaces foreach --verbose run test",
"rebuild-electron": "./node_modules/.bin/electron-rebuild -f -m ./packages/loot-core",
"rebuild-node": "yarn workspace loot-core rebuild",
- "lint": "yarn workspaces foreach --verbose run lint",
+ "lint": "yarn workspaces foreach --verbose run lint --max-warnings 0",
"postinstall": "rm -rf ./packages/loot-design/node_modules/react && rm -rf ./packages/mobile/node_modules/react && rm -rf ./node_modules/react-native && patch-package"
},
"devDependencies": {
diff --git a/packages/desktop-client/src/components/Tutorial.js b/packages/desktop-client/src/components/Tutorial.js
index 9f70791539..7d4e6d34d1 100644
--- a/packages/desktop-client/src/components/Tutorial.js
+++ b/packages/desktop-client/src/components/Tutorial.js
@@ -140,6 +140,10 @@ class Tutorial extends React.Component {
);
case 'budget-next-month':
return <div>hi</div>;
+ default:
+ throw new Error(
+ `Encountered an unexpected error rendering the tutorial content for ${stage}`
+ );
}
}
@@ -213,6 +217,8 @@ class Tutorial extends React.Component {
navigationProps={navigationProps}
/>
);
+ default:
+ // Default case defined below (outside the switch statement)
}
const { node: targetNode, expand } = this.context.getTutorialNode(stage);
@@ -244,7 +250,6 @@ class Tutorial extends React.Component {
<path
fill="rgba(0, 0, 0, .2)"
fill-rule="evenodd"
- // prettier-ignore
d={generatePath(targetRect, windowRect)}
style={{ pointerEvents: 'fill' }}
/>
diff --git a/packages/desktop-client/src/components/tutorial/Final.js b/packages/desktop-client/src/components/tutorial/Final.js
index 7b11fb056d..998f19870a 100644
--- a/packages/desktop-client/src/components/tutorial/Final.js
+++ b/packages/desktop-client/src/components/tutorial/Final.js
@@ -10,8 +10,12 @@ function Final({ targetRect, navigationProps }) {
<Title>That's it!</Title>
<P>
With that workflow you can have peace of mind that what you are looking
- at reflects reality. &#128524; The amount of money in a category is cash
- that you can safely spend right now.
+ at reflects reality.{' '}
+ <span role="img" aria-label="Relieved smile">
+ &#128524;
+ </span>{' '}
+ The amount of money in a category is cash that you can safely spend
+ right now.
</P>
<P>
diff --git a/packages/desktop-client/src/components/tutorial/Intro.js b/packages/desktop-client/src/components/tutorial/Intro.js
index 2bb9396398..b87847ea60 100644
--- a/packages/desktop-client/src/components/tutorial/Intro.js
+++ b/packages/desktop-client/src/components/tutorial/Intro.js
@@ -15,7 +15,10 @@ function Intro({ fromYNAB, nextTutorialStage, closeTutorial }) {
<Standalone width={500}>
<Title>Let's get started</Title>
<P>
- Welcome to Actual! &#127881;{' '}
+ Welcome to Actual!{' '}
+ <span role="img" aria-label="Party">
+ &#127881;
+ </span>{' '}
<strong>Learn the basic workflow with this quick tutorial.</strong> You
can always restart it from the File menu.
</P>
diff --git a/packages/desktop-electron/about/index.js b/packages/desktop-electron/about/index.js
index ef3a516c1f..1823ea78b6 100644
--- a/packages/desktop-electron/about/index.js
+++ b/packages/desktop-electron/about/index.js
@@ -2,9 +2,7 @@ const { ipcRenderer } = require('electron');
const root = document.querySelector('#root');
-const { version: appVersion } = ipcRenderer.sendSync(
- 'get-bootstrap-data'
-);
+const { version: appVersion } = ipcRenderer.sendSync('get-bootstrap-data');
const iconPath = __dirname + '/../icons/icon.png';
@@ -85,9 +83,7 @@ ipcRenderer.on('update-error', (event, msg) => {
text = 'Error updating the app. Please try again later.';
}
- // prettier-ignore
- errorEl.innerHTML =
- `<div style="text-align:center; color:#F65151">${text}</div>`;
+ errorEl.innerHTML = `<div style="text-align:center; color:#F65151">${text}</div>`;
errorEl.style.display = 'block';
});
diff --git a/packages/loot-design/src/svg/generate b/packages/loot-design/src/svg/generate
index f2cec51b58..00a13aaab8 100755
--- a/packages/loot-design/src/svg/generate
+++ b/packages/loot-design/src/svg/generate
@@ -162,7 +162,6 @@ function transformContents(name, contents, isReactNative) {
return null;
}
- // prettier-ignore
const reactNativeImport = `
import {${reactNativeTags.join(', ')}} from 'mobile/node_modules/react-native-svg'
`;
diff --git a/patches/eslint-config-react-app+3.0.5.patch b/patches/eslint-config-react-app+3.0.5.patch
deleted file mode 100644
index 976cb4a790..0000000000
--- a/patches/eslint-config-react-app+3.0.5.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-diff --git a/node_modules/eslint-config-react-app/index.js b/node_modules/eslint-config-react-app/index.js
-index ca232b8..2d88066 100644
---- a/node_modules/eslint-config-react-app/index.js
-+++ b/node_modules/eslint-config-react-app/index.js
-@@ -126,13 +126,6 @@ module.exports = {
- },
- ],
- 'no-unused-labels': 'warn',
-- 'no-unused-vars': [
-- 'warn',
-- {
-- args: 'none',
-- ignoreRestSiblings: true,
-- },
-- ],
- 'no-use-before-define': [
- 'warn',
- {