Skip to content

Commit

Permalink
Add rules; revert changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffdaley committed Oct 20, 2023
1 parent 5927957 commit 89fd8e1
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 14 deletions.
20 changes: 20 additions & 0 deletions web/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,26 @@ module.exports = {
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/no-redundant-type-constituents": "off",
"@typescript-eslint/require-await": "off",
"@typescript-eslint/no-floating-promises": "off",
"@typescript-eslint/unbound-method": "off",
"@typescript-eslint/no-misused-promises": "off",
"@typescript-eslint/restrict-template-expressions": "off",
"@typescript-eslint/no-misused-new": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/restrict-plus-operands": "off",
"@typescript-eslint/await-thenable": "off",
"@typescript-eslint/no-unsafe-enum-comparison": "off",
"@typescript-eslint/no-unnecessary-type-assertion": "off",
"no-case-declarations": "off",
"no-fallthrough": "off",
"prefer-const": "off",
"no-empty-pattern": "off",
"no-control-regex": "off",
"no-self-assign": "off",
"prefer-rest-params": "off",
"no-empty": "off",
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export default class DocumentSidebarRelatedResourcesListItemComponent extends Co
*/
protected get documentObjectID(): string | null {
if ("googleFileID" in this.args.resource) {
return this.args.resource.googleFileID;
return (this.args.resource as RelatedHermesDocument).googleFileID;
} else {
return null;
}
Expand Down
23 changes: 10 additions & 13 deletions web/tests/integration/components/related-resources/add-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module("Integration | Component | related-resources/add", function (hooks) {

const reducerFunction = (
acc: Record<string, HermesDocument>,
document: { attrs: HermesDocument },
document: { attrs: HermesDocument }
) => {
acc[document.attrs.objectID] = document.attrs;
return acc;
Expand All @@ -51,13 +51,10 @@ module("Integration | Component | related-resources/add", function (hooks) {
const getFirstFourRecords = (documents: any) => {
return Object.keys(documents)
.slice(0, 4)
.reduce(
(acc, key) => {
acc[key] = documents[key];
return acc;
},
{} as Record<string, HermesDocument>,
);
.reduce((acc, key) => {
acc[key] = documents[key];
return acc;
}, {} as Record<string, HermesDocument>);
};

suggestions = getFirstFourRecords(suggestions);
Expand All @@ -69,7 +66,7 @@ module("Integration | Component | related-resources/add", function (hooks) {
(
dd: XDropdownListAnchorAPI | null,
query: string,
shouldIgnoreDelay?: boolean,
shouldIgnoreDelay?: boolean
) => {
if (query === "") {
this.set("shownDocuments", suggestions);
Expand All @@ -82,7 +79,7 @@ module("Integration | Component | related-resources/add", function (hooks) {
this.set("shownDocuments", getFirstFourRecords(matches));
}
return Promise.resolve();
},
}
);

this.set("getObject", (dd: XDropdownListAnchorAPI | null, id: string) => {
Expand Down Expand Up @@ -153,11 +150,11 @@ module("Integration | Component | related-resources/add", function (hooks) {
// Here, we set it to resolve a promise after a timeout to
// allow us to capture its `isRunning` state.
this.set("search", () => {
return new Promise<void>((resolve) => {
return new Promise((resolve) => {
setTimeout(() => {
resolve();
}, 1000);
});
}) as Promise<void>;
});

await render<RelatedResourcesAddTestContext>(hbs`
Expand Down Expand Up @@ -304,4 +301,4 @@ module("Integration | Component | related-resources/add", function (hooks) {
.dom("[data-test-related-resources-search-loading-icon]")
.exists("a loading icon is shown when `searchIsRunning` is true");
});
});
});

0 comments on commit 89fd8e1

Please sign in to comment.