Skip to content

Commit

Permalink
👷 Add lint/formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
coyotte508 committed Jun 14, 2024
1 parent 3f2d054 commit ca6d4ee
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 47 deletions.
4 changes: 4 additions & 0 deletions packages/space-header/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pnpm-lock.yaml
# In order to avoid code samples to have tabs, they don't display well on npm
README.md
dist
40 changes: 22 additions & 18 deletions packages/space-header/package.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
{
"name": "@huggingface/space-header",
"version": "1.0.0",
"description": "",
"main": "index.js",
"type": "module",
"types": "dist/index.d.ts",
"module": "dist/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "tsup ./src"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"tsup": "^8.1.0",
"typescript": "^5.4.5"
}
"name": "@huggingface/space-header",
"version": "1.0.0",
"description": "",
"main": "index.js",
"type": "module",
"types": "dist/index.d.ts",
"module": "dist/index.js",
"scripts": {
"build": "tsup ./src",
"lint": "eslint --quiet --fix --ext .cjs,.ts .",
"lint:check": "eslint --ext .cjs,.ts .",
"format": "prettier --write .",
"format:check": "prettier --check .",
"prepublishOnly": "pnpm run build"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"tsup": "^8.1.0",
"typescript": "^5.4.5"
}
}
42 changes: 21 additions & 21 deletions packages/space-header/src/header/components/username.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
export const Username = (username: string) => {
const element = document.createElement("a");
export const Username: (username: string) => HTMLAnchorElement = (username: string) => {
const element = document.createElement("a");

element.setAttribute("href", `https://huggingface.co/${username}`);
element.setAttribute("rel", "noopener noreferrer");
element.setAttribute("target", "_blank");
element.setAttribute("href", `https://huggingface.co/${username}`);
element.setAttribute("rel", "noopener noreferrer");
element.setAttribute("target", "_blank");

element.style.color = "rgb(107, 114, 128)"
element.style.textDecoration = "none";
element.style.fontWeight = "400";
element.style.fontSize = "16px";
element.style.lineHeight = "24px";
element.style.flex = "none";
element.style.fontFamily = "Source Sans Pro, sans-serif"
element.style.color = "rgb(107, 114, 128)";
element.style.textDecoration = "none";
element.style.fontWeight = "400";
element.style.fontSize = "16px";
element.style.lineHeight = "24px";
element.style.flex = "none";
element.style.fontFamily = "Source Sans Pro, sans-serif";

element.addEventListener("mouseover", () => {
element.style.color = "#2563eb";
});
element.addEventListener("mouseout", () => {
element.style.color = "rgb(107, 114, 128)";
});
element.addEventListener("mouseover", () => {
element.style.color = "#2563eb";
});
element.addEventListener("mouseout", () => {
element.style.color = "rgb(107, 114, 128)";
});

element.textContent = username;
element.textContent = username;

return element;
}
return element;
};
16 changes: 8 additions & 8 deletions packages/space-header/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { defineConfig } from 'tsup'
import { defineConfig } from "tsup";

export default defineConfig({
target: 'es2020',
format: ['cjs', 'esm'],
splitting: false,
sourcemap: true,
clean: true,
dts: true
})
target: "es2020",
format: ["cjs", "esm"],
splitting: false,
sourcemap: true,
clean: true,
dts: true,
});
1 change: 1 addition & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ packages:
- "packages/tasks"
- "packages/gguf"
- "packages/jinja"
- "packages/space-header"

0 comments on commit ca6d4ee

Please sign in to comment.