Skip to content

Commit d89d1bd

Browse files
committed
lint: format & lint
1 parent 9045827 commit d89d1bd

File tree

6 files changed

+31
-13
lines changed

6 files changed

+31
-13
lines changed

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@
44
"description": "Firefox addon to add repository size to their Github homepage",
55
"main": "src/index.js",
66
"scripts": {
7-
"build": "npm-run-all --parallel build:main build:options copyAssets",
7+
"build": "npm-run-all --parallel build:main build:options copyAssets copyIcons",
88
"build:main": "parcel build src/index.ts --public-url ./",
99
"build:options": "parcel build src/options.ts --public-url ./",
10-
"watch": "npm-run-all --parallel watch:main watch:options copyAssets",
10+
"watch": "npm-run-all --parallel watch:main watch:options copyAssets copyIcons",
1111
"watch:main": "parcel watch src/index.ts --public-url ./",
1212
"watch:options": "parcel watch src/options.ts --public-url ./",
13-
"copyAssets": "cpy manifest.json icon/icon.svg LICENSE.md README.md package.json tsconfig.json yarn.lock src/options.html dist/",
13+
"copyAssets": "cpy manifest.json LICENSE.md README.md package.json tsconfig.json yarn.lock src/options.html dist/",
14+
"copyIcons": "cpy --parents icon/icon.svg dist/",
1415
"webext:run": "web-ext run -s ./dist",
15-
"webext:lint": "web-ext lint"
16+
"webext:lint": "web-ext lint -s ./dist"
1617
},
1718
"author": "Matthieu Harlé",
1819
"license": "MIT",

src/constants.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,24 @@ export const TOKEN_KEY = 'grs_gh_token'
22
export const GITHUB_API = 'https://api.github.com/graphql'
33
export const GITHUB_API_V3 = 'https://api.github.com/repos/'
44
export const REPO_STATS_CLASS = 'numbers-summary'
5-
export const REPO_REFRESH_STATS_QUERY = '.repository-content .Box-header .Details ul'
5+
export const REPO_REFRESH_STATS_QUERY =
6+
'.repository-content .Box-header .Details ul'
67
export const REPO_SIZE_ID = 'addon-repo-size'
78
export const SIZE_KILO = 1024
8-
export const UNITS = ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB']
9+
export const UNITS = [
10+
'B',
11+
'KiB',
12+
'MiB',
13+
'GiB',
14+
'TiB',
15+
'PiB',
16+
'EiB',
17+
'ZiB',
18+
'YiB',
19+
]
920
export const AUTO_ASK_KEY = 'grs_auto_ask'
1021
export const MODAL_ID = 'grs_token_modal'
1122
export const TOKEN_INPUT_ID = 'grs_token_input'
1223

1324
export const ERROR_UNAUTHORIZED = '401'
14-
export const ERROR_UNKNOWN = '-1'
25+
export const ERROR_UNKNOWN = '-1'

src/dom.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export const createSizeWrapperElement = async (
8686
}
8787
const li = document.createElement('li')
8888
li.id = REPO_SIZE_ID
89-
li.className = "ml-0 ml-md-3"
89+
li.className = 'ml-0 ml-md-3'
9090

9191
li.innerHTML = `
9292
<details id="${MODAL_ID}-size-stat-wrapper" class="details-reset details-overlay details-overlay-dark">

src/index.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,15 @@ const injectRepoSize = async () => {
146146
} catch (err: unknown) {
147147
if (err instanceof Error) {
148148
if (err.message === ERROR_UNAUTHORIZED) {
149-
createSizeWrapperElement(statsElt, createErrorElement('Unauthorized Token!'))
149+
createSizeWrapperElement(
150+
statsElt,
151+
createErrorElement('Unauthorized Token!')
152+
)
150153
} else {
151-
createSizeWrapperElement(statsElt, createErrorElement('Unknown Error!'))
154+
createSizeWrapperElement(
155+
statsElt,
156+
createErrorElement('Unknown Error!')
157+
)
152158
}
153159
}
154160
}

src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ export type PartialGitHubRepo = {
1818

1919
export type PartialGitHubRepoRestV3 = {
2020
size: number
21-
}
21+
}

src/userSettings.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ export const getStoredSetting = async (key: string) => {
55

66
export const setSetting = async (key: string, value: unknown) => {
77
await browser.storage.local.set({
8-
[key]: value
8+
[key]: value,
99
})
10-
}
10+
}

0 commit comments

Comments
 (0)