Skip to content

Commit

Permalink
Merge pull request #263 from bradcush/prettier-three
Browse files Browse the repository at this point in the history
chore(format): update formatting with prettier three
  • Loading branch information
jarrodBrandreth authored Sep 1, 2023
2 parents bdc0d5a + 830f5b2 commit 8fabf52
Show file tree
Hide file tree
Showing 50 changed files with 81 additions and 81 deletions.
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion meta/manifest/__tests__/generate.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ describe('generate', () => {
describe('when manifest generation is run as shell script', () => {
test('should write any manifest to standard output', () => {
const manifestBuffer = childProcess.execSync(
'bun meta/manifest/run.ts --browser chromium'
'bun meta/manifest/run.ts --browser chromium',
);
// JSON.parse type declarations specify any return value
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
"eslint": "^8.42.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-json": "^3.1.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-prettier": "^5.0.0",
"husky": "^4.3.8",
"prettier": "^2.8.8",
"prettier": "^3.0.2",
"ts-loader": "^7.0.5",
"typescript": "5.0.4"
}
Expand Down
2 changes: 1 addition & 1 deletion src/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function initialize(infrastructure: InitializeInfra) {
// Load settings from storage
const persistedStoreInstance = new PersistedStore(
storageSyncGet,
storageSyncSet
storageSyncSet,
);
void persistedStoreInstance.load();
// Set instance for direct use without
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ describe('actionSetBadgeBackgroundColor', () => {
setBadgeBackgroundColor: mock(
(
_details: chrome.action.BadgeBackgroundColorDetails,
callback: () => void
callback: () => void,
) => {
callback();
}
},
),
},
runtime: {},
Expand Down
4 changes: 2 additions & 2 deletions src/infra/browser/action/__tests__/set-badge-text.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ describe('actionSetBadgeText', () => {
setBadgeText: mock(
(
_details: chrome.action.BadgeTextDetails,
callback: () => void
callback: () => void,
) => {
callback();
}
},
),
},
runtime: {},
Expand Down
2 changes: 1 addition & 1 deletion src/infra/browser/action/set-badge-background-color.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export function actionSetBadgeBackgroundColor(
details: chrome.action.BadgeBackgroundColorDetails
details: chrome.action.BadgeBackgroundColorDetails,
): Promise<void> {
return new Promise((resolve, reject) => {
chrome.action.setBadgeBackgroundColor(details, () => {
Expand Down
2 changes: 1 addition & 1 deletion src/infra/browser/action/set-badge-text.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export function actionSetBadgeText(
details: chrome.action.BadgeTextDetails
details: chrome.action.BadgeTextDetails,
): Promise<void> {
return new Promise((resolve, reject) => {
chrome.action.setBadgeText(details, () => {
Expand Down
2 changes: 1 addition & 1 deletion src/infra/browser/commands/on-command.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function addListener(
callback: (command: string, tab: chrome.tabs.Tab) => void
callback: (command: string, tab: chrome.tabs.Tab) => void,
): void {
chrome.commands.onCommand.addListener((command, tab) => {
if (chrome.runtime.lastError) {
Expand Down
4 changes: 2 additions & 2 deletions src/infra/browser/context-menus/__tests__/create.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ describe('contextMenusCreate', () => {
create: mock(
(
_createProperties: chrome.contextMenus.CreateProperties,
callback: () => void
callback: () => void,
) => {
callback();
}
},
),
},
runtime: {},
Expand Down
2 changes: 1 addition & 1 deletion src/infra/browser/context-menus/create.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export function contextMenusCreate(
createProperties: chrome.contextMenus.CreateProperties
createProperties: chrome.contextMenus.CreateProperties,
): Promise<void> {
return new Promise((resolve, reject) => {
chrome.contextMenus.create(createProperties, () => {
Expand Down
4 changes: 2 additions & 2 deletions src/infra/browser/context-menus/on-clicked.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
function addListener(
callback: (
info: chrome.contextMenus.OnClickData,
tab?: chrome.tabs.Tab
) => void
tab?: chrome.tabs.Tab,
) => void,
): void {
chrome.contextMenus.onClicked.addListener((info, tab) => {
if (chrome.runtime.lastError) {
Expand Down
2 changes: 1 addition & 1 deletion src/infra/browser/management/on-enabled.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function addListener(
callback: (info: chrome.management.ExtensionInfo) => void
callback: (info: chrome.management.ExtensionInfo) => void,
): void {
chrome.management.onEnabled.addListener((info) => {
if (chrome.runtime.lastError) {
Expand Down
2 changes: 1 addition & 1 deletion src/infra/browser/runtime/on-installed.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function addListener(
callback: (details: chrome.runtime.InstalledDetails) => void
callback: (details: chrome.runtime.InstalledDetails) => void,
): void {
chrome.runtime.onInstalled.addListener((details) => {
if (chrome.runtime.lastError) {
Expand Down
4 changes: 2 additions & 2 deletions src/infra/browser/storage/sync/__tests__/get.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ describe('storageSyncGet', () => {
get: mock(
(
_keys: string | Record<string, unknown>,
callback: (items: Record<string, unknown>) => void
callback: (items: Record<string, unknown>) => void,
) => {
const items = {
settings: 'settings',
};
callback(items);
}
},
),
},
},
Expand Down
4 changes: 2 additions & 2 deletions src/infra/browser/storage/sync/__tests__/set.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ describe('storageSyncSet', () => {
set: mock(
(
_items: Record<string, unknown>,
callback: () => void
callback: () => void,
) => {
callback();
}
},
),
},
},
Expand Down
2 changes: 1 addition & 1 deletion src/infra/browser/storage/sync/get.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export function storageSyncGet(
keys: string | Record<string, unknown>
keys: string | Record<string, unknown>,
): Promise<Record<string, unknown>> {
return new Promise<Record<string, unknown>>((resolve, reject) => {
chrome.storage.sync.get(keys, (items) => {
Expand Down
8 changes: 4 additions & 4 deletions src/infra/browser/tab-groups/__tests__/query.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('tabGroupsQuery', () => {
(global.chrome as any).tabGroups.query = mock(
(
_queryInfo: chrome.tabGroups.QueryInfo,
callback: (groups: chrome.tabGroups.TabGroup[]) => void
callback: (groups: chrome.tabGroups.TabGroup[]) => void,
) => {
const group = {
collapsed: false,
Expand All @@ -47,7 +47,7 @@ describe('tabGroupsQuery', () => {
windowId: 1,
};
callback([group]);
}
},
);
global.chrome.runtime.lastError = undefined;
const queryInfo = { title: 'match' };
Expand All @@ -68,10 +68,10 @@ describe('tabGroupsQuery', () => {
(global.chrome as any).tabGroups.query = mock(
(
_queryInfo: chrome.tabGroups.QueryInfo,
callback: (groups: chrome.tabGroups.TabGroup[]) => void
callback: (groups: chrome.tabGroups.TabGroup[]) => void,
) => {
callback([]);
}
},
);
global.chrome.runtime.lastError = {
message: 'error',
Expand Down
6 changes: 3 additions & 3 deletions src/infra/browser/tab-groups/__tests__/update.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ describe('tabGroupsUpdate', () => {
(
_groupId: number,
_updateProperties: chrome.tabGroups.UpdateProperties,
callback: () => void
callback: () => void,
) => {
callback();
}
},
),
},
runtime: {},
Expand Down Expand Up @@ -54,7 +54,7 @@ describe('tabGroupsUpdate', () => {
const groupId = 1;
const updateProperties = { title: 'title' };
expect(tabGroupsUpdate(groupId, updateProperties)).rejects.toBe(
'error'
'error',
);
});
});
2 changes: 1 addition & 1 deletion src/infra/browser/tab-groups/on-updated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export function isTabGroupsOnUpdatedSupported(): boolean {
}

function addListener(
callback: (group: chrome.tabGroups.TabGroup) => void
callback: (group: chrome.tabGroups.TabGroup) => void,
): void {
if (!isTabGroupsOnUpdatedSupported()) {
throw new Error('No tabGroups.onUpdated support');
Expand Down
2 changes: 1 addition & 1 deletion src/infra/browser/tab-groups/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export function isTabGroupsQuerySupported(): boolean {
}

export function tabGroupsQuery(
queryInfo: chrome.tabGroups.QueryInfo
queryInfo: chrome.tabGroups.QueryInfo,
): Promise<chrome.tabGroups.TabGroup[]> {
if (!isTabGroupsQuerySupported()) {
throw new Error('No tabGroups.query support');
Expand Down
2 changes: 1 addition & 1 deletion src/infra/browser/tab-groups/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export function isTabGroupsUpdateSupported(): boolean {

export function tabGroupsUpdate(
groupId: number,
updateProperties: chrome.tabGroups.UpdateProperties
updateProperties: chrome.tabGroups.UpdateProperties,
): Promise<void> {
if (!isTabGroupsUpdateSupported()) {
throw new Error('No tabGroups.update support');
Expand Down
4 changes: 2 additions & 2 deletions src/infra/browser/tabs/__tests__/create.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ describe('tabsCreate', () => {
create: mock(
(
_createProerties: chrome.tabs.CreateProperties,
callback: (tab: chrome.tabs.Tab) => void
callback: (tab: chrome.tabs.Tab) => void,
) => {
const tab = {
id: 1,
} as chrome.tabs.Tab;
callback(tab);
}
},
),
},
runtime: {},
Expand Down
4 changes: 2 additions & 2 deletions src/infra/browser/tabs/__tests__/discard.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ describe('tabsDiscard', () => {
discard: mock(
(
_tabId: number,
callback: (tab: chrome.tabs.Tab) => void
callback: (tab: chrome.tabs.Tab) => void,
) => {
const tab = {
id: 1,
} as chrome.tabs.Tab;
callback(tab);
}
},
),
},
runtime: {},
Expand Down
2 changes: 1 addition & 1 deletion src/infra/browser/tabs/__tests__/get.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('tabsGet', () => {
windowId: 2,
} as chrome.tabs.Tab;
callback(tab);
}
},
),
},
runtime: {},
Expand Down
4 changes: 2 additions & 2 deletions src/infra/browser/tabs/__tests__/group.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ describe('tabsGroup', () => {
group: mock(
(
_options: chrome.tabs.GroupOptions,
callback: (groupId: number) => void
callback: (groupId: number) => void,
) => {
const groupId = 2;
callback(groupId);
}
},
),
},
runtime: {},
Expand Down
4 changes: 2 additions & 2 deletions src/infra/browser/tabs/__tests__/move.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ describe('tabsMove', () => {
(
_id: number,
_moveProperties: chrome.tabs.MoveProperties,
callback: () => void
callback: () => void,
) => {
callback();
}
},
),
},
runtime: {},
Expand Down
4 changes: 2 additions & 2 deletions src/infra/browser/tabs/__tests__/query.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ describe('tabsQuery', () => {
query: mock(
(
_queryInfo: chrome.tabs.QueryInfo,
callback: (tabs: chrome.tabs.Tab[]) => void
callback: (tabs: chrome.tabs.Tab[]) => void,
) => {
const tab = {
id: 1,
windowId: 2,
} as chrome.tabs.Tab;
callback([tab]);
}
},
),
},
runtime: {},
Expand Down
2 changes: 1 addition & 1 deletion src/infra/browser/tabs/create.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export function tabsCreate(
createProperties: chrome.tabs.CreateProperties
createProperties: chrome.tabs.CreateProperties,
): Promise<chrome.tabs.Tab> {
return new Promise((resolve, reject) => {
chrome.tabs.create(createProperties, (tab) => {
Expand Down
2 changes: 1 addition & 1 deletion src/infra/browser/tabs/move.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export function tabsMove(
id: number,
moveProperties: chrome.tabs.MoveProperties
moveProperties: chrome.tabs.MoveProperties,
): Promise<void> {
return new Promise((resolve, reject) => {
chrome.tabs.move(id, moveProperties, () => {
Expand Down
2 changes: 1 addition & 1 deletion src/infra/browser/tabs/on-removed.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function addListener(
callback: (tabId: number, removeInfo: chrome.tabs.TabRemoveInfo) => void
callback: (tabId: number, removeInfo: chrome.tabs.TabRemoveInfo) => void,
): void {
chrome.tabs.onRemoved.addListener((tabId, removeInfo) => {
if (chrome.runtime.lastError) {
Expand Down
4 changes: 2 additions & 2 deletions src/infra/browser/tabs/on-updated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ function addListener(
callback: (
tabId: number,
changeInfo: chrome.tabs.TabChangeInfo,
tab: chrome.tabs.Tab
) => void
tab: chrome.tabs.Tab,
) => void,
): void {
chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => {
if (chrome.runtime.lastError) {
Expand Down
2 changes: 1 addition & 1 deletion src/infra/browser/tabs/query.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export function tabsQuery(
queryInfo: chrome.tabs.QueryInfo
queryInfo: chrome.tabs.QueryInfo,
): Promise<chrome.tabs.Tab[]> {
return new Promise<chrome.tabs.Tab[]>((resolve, reject) => {
chrome.tabs.query(queryInfo, (tabs) => {
Expand Down
2 changes: 1 addition & 1 deletion src/infra/business/context-menus/create-leveled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export async function contextMenusCreateLeveled(
heading: string,
children: MenuItem[],
label: string,
location: chrome.contextMenus.ContextType
location: chrome.contextMenus.ContextType,
): Promise<void> {
// Finish creating the menu heading
// before linking it's children
Expand Down
2 changes: 1 addition & 1 deletion src/infra/business/tab-groups/get-color-from-index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { getTabGroupsColor } from 'src/infra/browser/tab-groups/constants/colors
* is valid for a tab group
*/
function isTabGroupsColorValid(
color: string
color: string,
): color is chrome.tabGroups.ColorEnum {
const colors = [
'blue',
Expand Down
2 changes: 1 addition & 1 deletion src/infra/business/tab-groups/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function tabGroupsRender(
action: 'ungroup';
tabIds: number[];
}
)[]
)[],
): void {
tabCollectionItems.forEach((item) => {
const { action } = item;
Expand Down
2 changes: 1 addition & 1 deletion src/infra/business/tabs/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function tabsRender(
tabs: {
identifier?: number;
windowId?: number;
}[]
}[],
): void {
tabs.forEach(({ identifier, windowId }) => {
if (!identifier) {
Expand Down
Loading

0 comments on commit 8fabf52

Please sign in to comment.