Turn on strict mode in tsconfig.json

- Add route, clusterRoute, and payloadValidatedClusterRoute helper
  functions to improve types with backend routes

- Turn on the following new lints:
  - react/jsx-first-prop-new-line
  - react/jsx-wrap-multilines
  - react/jsx-one-expression-per-line
  - react/jsx-max-props-per-line
  - react/jsx-indent
  - react/jsx-indent-props

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton committed 2022-05-04 08:45:50 -04:00
1 parent e532b90b72
commit f594bf03f3
689 files changed
+14529 -11302

No files matched your search

@@ -9,8 +9,9 @@ import { getElectronAppPath } from "./get-electron-app-path";
const getElectronAppPathInjectable = getInjectable({
id: "get-electron-app-path",
instantiate: (di) =>
getElectronAppPath({ app: di.inject(electronAppInjectable) }),
instantiate: (di) => getElectronAppPath({
app: di.inject(electronAppInjectable),
}),
});
export default getElectronAppPathInjectable;
@@ -11,7 +11,7 @@ import joinPathsInjectable from "../../../common/path/join-paths.injectable";
import { joinPathsFake } from "../../../common/test-utils/join-paths-fake";
describe("get-electron-app-path", () => {
let getElectronAppPath: (name: string) => string | null;
let getElectronAppPath: (name: string) => string;
beforeEach(async () => {
const di = getDiForUnitTesting({ doGeneralOverrides: false });
@@ -37,7 +37,7 @@ describe("get-electron-app-path", () => {
await di.runSetups();
getElectronAppPath = di.inject(getElectronAppPathInjectable);
getElectronAppPath = di.inject(getElectronAppPathInjectable) as (name: string) => string;
});
it("given app path exists, when called, returns app path", () => {
@@ -9,12 +9,16 @@ interface Dependencies {
app: App;
}
export const getElectronAppPath =
({ app }: Dependencies) =>
(name: PathName) : string | null => {
try {
return app.getPath(name);
} catch (e) {
return "";
}
};
export type GetElectronAppPath = (name: PathName) => string;
export const getElectronAppPath = ({
app,
}: Dependencies): GetElectronAppPath => (
(name) => {
try {
return app.getPath(name);
} catch (e) {
return "";
}
}
);