Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/components/EntryPointsTabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ export interface EntryPointsTabsProps {
}

/** This component renders a library's entrypoints as linked tabs. */
export class EntryPointsTabs extends React.Component<EntryPointsTabsProps, {}> {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line failed eslint with:

circulation-admin/src/components/EntryPointsTabs.tsx
       17:76  error  Don't use `{}` as a type. `{}` actually means "any non-nullish value".
     - If you want a type meaning "any object", you probably want `object` instead.
     - If you want a type meaning "any value", you probably want `unknown` instead.
     - If you want a type meaning "empty object", you probably want `Record<string, never>` instead.
     - If you really want a type meaning "any non-nullish value", you probably want `NonNullable<unknown>` instead  @typescript-eslint/ban-types

Not related to any change I made, but maybe got picked up because I modified this file.

export class EntryPointsTabs extends React.Component<
EntryPointsTabsProps,
Record<string, never>
> {
context: EntryPointsTabsContext;

constructor(props) {
Expand All @@ -34,7 +37,7 @@ export class EntryPointsTabs extends React.Component<EntryPointsTabsProps, {}> {

const mapEntryPointsToSchema = {
All: "http://schema.org/CreativeWork",
eBooks: "http://schema.org/EBook",
Ebooks: "http://schema.org/EBook",
Audiobooks: "http://bib.schema.org/Audiobook",
};
const svgMediumTypes = {
Expand Down
2 changes: 1 addition & 1 deletion src/components/__tests__/EntryPointsContainer-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe("EntryPointsContainer", () => {
{
facets: [
{
label: "eBooks",
label: "Ebooks",
href:
"http://circulation.librarysimplified.org/groups/?entrypoint=Book",
active: false,
Expand Down
6 changes: 3 additions & 3 deletions src/components/__tests__/EntryPointsTabs-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe("EntryPointsTabs", () => {
let push;
let facets = [
{
label: "eBooks",
label: "Ebooks",
href: "http://circulation.librarysimplified.org/groups/?entrypoint=Book",
active: true,
},
Expand Down Expand Up @@ -51,7 +51,7 @@ describe("EntryPointsTabs", () => {

const bookLink = catalogLinks.at(0);
const audioLink = catalogLinks.at(1);
expect(bookLink.children().at(1).text()).to.equal("eBooks");
expect(bookLink.children().at(1).text()).to.equal("Ebooks");
expect(audioLink.children().at(1).text()).to.equal("Audiobooks");
});

Expand All @@ -62,7 +62,7 @@ describe("EntryPointsTabs", () => {
const ebookLink = links.at(0);
const audioBookLink = links.at(1);

expect(ebookLink.children().at(1).text()).to.equal("eBooks");
expect(ebookLink.children().at(1).text()).to.equal("Ebooks");

expect(audioBookLink.children().at(1).text()).to.equal("Audiobooks");
});
Expand Down