Skip to content

Commit 50553a2

Browse files
Reformat files with Prettier
1 parent b85cd60 commit 50553a2

67 files changed

Lines changed: 792 additions & 672 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

bin/build/build-font.ts

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { FontAssetType, generateFonts, OtherAssetType } from '@twbs/fantasticon'
2-
import ansiColors from "ansi-colors"
3-
import { execSync } from "child_process"
4-
import { existsSync, mkdirSync, readFileSync } from "fs"
2+
import ansiColors from 'ansi-colors'
3+
import { execSync } from 'child_process'
4+
import { existsSync, mkdirSync, readFileSync } from 'fs'
55
import SVGFixer from 'oslllo-svg-fixer'
6-
import path from "path"
6+
import path from 'path'
77
import codepoints from '../../icons/fonts/ProIcons.json' with { type: 'json' }
88

99
const version = JSON.parse(readFileSync('package.json', 'utf-8')).version
@@ -57,21 +57,19 @@ export async function buildFont(rebuild: boolean) {
5757
fontHeight: 500,
5858
codepoints,
5959
templates: {
60-
html: path.resolve('tools/data/html-font.hbs')
60+
html: path.resolve('tools/data/html-font.hbs'),
6161
},
6262
fontTypes: [
6363
FontAssetType.TTF,
6464
FontAssetType.WOFF,
6565
FontAssetType.WOFF2,
6666
FontAssetType.EOT,
6767
],
68-
assetTypes: [
69-
OtherAssetType.HTML,
70-
OtherAssetType.CSS,
71-
],
68+
assetTypes: [OtherAssetType.HTML, OtherAssetType.CSS],
7269
formatOptions: {
7370
ttf: {
74-
description: 'Modern and open-source icons, designed by ProCode-Software',
71+
description:
72+
'Modern and open-source icons, designed by ProCode-Software',
7573
version: version.slice(0, -2),
7674
url: 'https://procode-software.github.io/proicons',
7775
copyright: ${new Date().getFullYear()} ProCode Software`,
@@ -82,9 +80,8 @@ export async function buildFont(rebuild: boolean) {
8280
})
8381

8482
console.log(ansiColors.green('Done building fonts!'))
85-
8683
} catch (err) {
8784
console.log(ansiColors.red('Error building fonts:'))
8885
throw new Error(err)
8986
}
90-
}
87+
}

bin/build/fix-image.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import pixelfix from '@proicons/pixelfix'
33
import sharp from 'sharp'
44
import path from 'path'
55

6-
export default async ({ file, root }: {file: string, root: string}) => {
6+
export default async ({ file, root }: { file: string; root: string }) => {
77
const pngSizes = [24, 72, 120]
88
const outDir = path.resolve(root, 'icons/svg')
9-
9+
1010
for (const size of pngSizes) {
1111
const colors = ['black', 'white']
1212
const scale = size / 24
@@ -23,12 +23,15 @@ export default async ({ file, root }: {file: string, root: string}) => {
2323
const newFilePath = path.resolve(newFolder, color, `${file.slice(0, -4)}.png`)
2424

2525
try {
26-
await sharp(Buffer.from(fileStr)).resize(size, size).png().toFile(newFilePath)
26+
await sharp(Buffer.from(fileStr))
27+
.resize(size, size)
28+
.png()
29+
.toFile(newFilePath)
2730
await pixelfix(newFilePath)
2831
} catch (error) {
2932
console.error(`Failed to generate ${file}`, error)
3033
}
3134
}
3235
}
3336
return true
34-
}
37+
}

bin/generateChangelog.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ export function generateChangelog() {
1717
if (added == version) {
1818
newIcons.push(name)
1919
} else if (updated == version) {
20-
21-
const [renamedAlias] = Object.entries(lockfile.aliases).find(([, v]) => v == name) ?? []
20+
const [renamedAlias] =
21+
Object.entries(lockfile.aliases).find(([, v]) => v == name) ?? []
2222
if (renamedAlias) renamedIcons.push(`${renamedAlias}${name}`)
2323
else updatedIcons.push(name)
2424
}

bin/generateCodepoints.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const codepoints = JSON.parse(readFileSync(codepointsPath, 'utf-8') ?? '{}')
1313
for (const [i, { name }] of lockfile.icons.entries()) {
1414
const kebabName = kebabCase(name)
1515
if (!(kebabName in codepoints)) {
16-
codepoints[kebabName] = 0xE000 + i
16+
codepoints[kebabName] = 0xe000 + i
1717
}
1818
}
1919
// Cleanup codepoints

bin/helpers/getCliParam.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
/**
22
* @returns {string?}
3-
* @param {NodeJS.Process} nodeProcess
4-
* @param {...string} keys
3+
* @param {NodeJS.Process} nodeProcess
4+
* @param {...string} keys
55
*/
66
export function getCliParams(nodeProcess, ...keys) {
77
const args = nodeProcess.argv.slice(2)
88

99
for (const key of keys) {
1010
if (args.includes('-' + key) || args.includes('--' + key)) {
11-
const index = args.indexOf('-' + key) != -1
12-
? args.indexOf('-' + key)
13-
: args.indexOf('--' + key)
11+
const index =
12+
args.indexOf('-' + key) != -1
13+
? args.indexOf('-' + key)
14+
: args.indexOf('--' + key)
1415

1516
return args[index + 1]
1617
}
1718
}
18-
}
19+
}

bin/helpers/rename.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from '../../src/rename.ts'
1+
export * from '../../src/rename.ts'

packages/proicons-react/bin/reactIconTemplate.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getData, type Node } from "../../../bin/build/templates/templateData.ts";
1+
import { getData, type Node } from '../../../bin/build/templates/templateData.ts'
22

33
export default (moduleName: string, nodes: Node[]): string => {
44
const {
@@ -29,4 +29,4 @@ const ${moduleName} = createIcon(${JSON.stringify(iconInfo)}, ${JSON.stringify(n
2929
3030
export { ${moduleName} }
3131
`.trim()
32-
}
32+
}

packages/proicons-react/src/ProIcon.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ interface ProIconComponent extends ProIconAttributes {
2222

2323
export function getPascalName(name: string): string | undefined {
2424
const lowerName = name.toLowerCase()
25-
25+
2626
return (
2727
Object.keys(icons).find(pascalName => {
2828
const lowerIconName = pascalName.replace(/Icon$/, '').toLowerCase()
@@ -39,7 +39,7 @@ export function getPascalName(name: string): string | undefined {
3939

4040
/**
4141
* Generic icon component allowing you to import icons by their name
42-
*
42+
*
4343
* Note: This breaks tree-shaking
4444
* @example ```jsx
4545
* <ProIcon icon="Add Square" />

packages/proicons-react/src/proicons-react.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import * as icons from './icons'
22

33
export {
44
/** List of all available icons as components.
5-
*
5+
*
66
* [View the list of icons here](https://procode-software.github.io/proicons/icons)
7-
*
7+
*
88
* Note: This will import all icons and breaks tree-shaking
99
*/
10-
icons
10+
icons,
1111
}
1212
export { ProIcon } from './ProIcon'
1313

14-
export * from './icons'
14+
export * from './icons'

packages/proicons-react/tsconfig.json

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22
"compilerOptions": {
33
"target": "ES2022",
44
"useDefineForClassFields": true,
5-
"lib": [
6-
"ESNext",
7-
"DOM",
8-
"DOM.Iterable",
9-
],
5+
"lib": ["ESNext", "DOM", "DOM.Iterable"],
106
"module": "ESNext",
117

128
// Bundler mode
@@ -15,10 +11,8 @@
1511
"isolatedModules": true,
1612
"moduleDetection": "force",
1713
"jsx": "react-jsx",
18-
"types": [
19-
"vite/client"
20-
],
21-
14+
"types": ["vite/client"],
15+
2216
// Output
2317
"emitDeclarationOnly": true,
2418
"declarationDir": "./dist/types",
@@ -32,9 +26,7 @@
3226
"noUnusedParameters": false,
3327
"noFallthroughCasesInSwitch": true,
3428
"noImplicitAny": false,
35-
"skipLibCheck": true,
29+
"skipLibCheck": true
3630
},
37-
"include": [
38-
"src"
39-
],
40-
}
31+
"include": ["src"]
32+
}

0 commit comments

Comments
 (0)