Skip to content

Commit

Permalink
migrate to biome
Browse files Browse the repository at this point in the history
  • Loading branch information
aruncveli committed Jan 13, 2025
1 parent 5e46fec commit abc3cdb
Show file tree
Hide file tree
Showing 13 changed files with 67 additions and 124 deletions.
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*.json
**/*.ts
**/*.js
**/*.css
3 changes: 0 additions & 3 deletions .stylelintignore

This file was deleted.

4 changes: 0 additions & 4 deletions .stylelintrc.yml

This file was deleted.

30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ extension [Stylus](https://github.com/openstyles/stylus). After installing the
extension, click on any of the below links to install the corresponding user
style.

| Name | | |
| :-------------------: | :---------------------------------------------------------------------------------------------------------------: | :---------------------------: |
| Arch Linux | [Install](https://raw.githubusercontent.com/aruncveli/userstyles/refs/heads/main/sites/archlinux/archlinux.user.css) | [Info](sites/archlinux) |
| snowfl | [Install](https://github.com/aruncveli/userstyles/raw/main/snowfl/snowfl.user.styl) | [Info](snowfl) |
| Hacker News | [Install](https://github.com/aruncveli/userstyles/raw/main/hackernews/hackernews.user.styl) | [Info](hackernews) |
| Apotea | [Install](https://raw.githubusercontent.com/aruncveli/userstyles/refs/heads/main/sites/apotea/apotea.user.css) | [Info](sites/apotea) |
| SMHI | [Install](https://github.com/aruncveli/userstyles/raw/main/smhi/smhi.user.styl) | [Info](smhi) |
| Trafikinformation tåg | [Install](https://github.com/aruncveli/userstyles/raw/main/trafikinformation-tåg/trafikinformation-tåg.user.styl) | [Info](trafikinformation-tåg) |
| npm Docs | [Install](https://github.com/aruncveli/userstyles/raw/main/npm-docs/npm-docs.user.styl) | [Info](npm-docs) |
| npm | [Install](https://github.com/aruncveli/userstyles/raw/main/npm/npm.user.styl) | [Info](npm) |
| PSArips | [Install](https://github.com/aruncveli/userstyles/raw/main/psarips/psarips.user.styl) | [Info](psarips) |
| YouGov | [Install](https://github.com/aruncveli/userstyles/raw/main/yougov/yougov.user.styl) | [Info](yougov) |
| AWS CDK | [Install](https://github.com/aruncveli/userstyles/raw/main/aws-cdk/aws-cdk.user.styl) | [Info](aws-cdk) |
| KTH Canvas | [Install](https://github.com/aruncveli/userstyles/raw/main/kth-canvas/kth-canvas.user.styl) | [Info](kth-canvas) |
| Grammarly | [Install](https://github.com/aruncveli/userstyles/raw/main/grammarly/grammarly.user.styl) | [Info](grammarly) |
| Name | | |
| :-------------------: | :------------------------------------------------------------------------------------------------------------------: | :---------------------------: |
| Arch Linux | [Install](https://raw.githubusercontent.com/aruncveli/userstyles/refs/heads/main/sites/archlinux/archlinux.user.css) | [Info](sites/archlinux) |
| snowfl | [Install](https://github.com/aruncveli/userstyles/raw/main/snowfl/snowfl.user.styl) | [Info](snowfl) |
| Hacker News | [Install](https://github.com/aruncveli/userstyles/raw/main/hackernews/hackernews.user.styl) | [Info](hackernews) |
| Apotea | [Install](https://raw.githubusercontent.com/aruncveli/userstyles/refs/heads/main/sites/apotea/apotea.user.css) | [Info](sites/apotea) |
| SMHI | [Install](https://github.com/aruncveli/userstyles/raw/main/smhi/smhi.user.styl) | [Info](smhi) |
| Trafikinformation tåg | [Install](https://github.com/aruncveli/userstyles/raw/main/trafikinformation-tåg/trafikinformation-tåg.user.styl) | [Info](trafikinformation-tåg) |
| npm Docs | [Install](https://github.com/aruncveli/userstyles/raw/main/npm-docs/npm-docs.user.styl) | [Info](npm-docs) |
| npm | [Install](https://github.com/aruncveli/userstyles/raw/main/npm/npm.user.styl) | [Info](npm) |
| PSArips | [Install](https://github.com/aruncveli/userstyles/raw/main/psarips/psarips.user.styl) | [Info](psarips) |
| YouGov | [Install](https://github.com/aruncveli/userstyles/raw/main/yougov/yougov.user.styl) | [Info](yougov) |
| AWS CDK | [Install](https://github.com/aruncveli/userstyles/raw/main/aws-cdk/aws-cdk.user.styl) | [Info](aws-cdk) |
| KTH Canvas | [Install](https://github.com/aruncveli/userstyles/raw/main/kth-canvas/kth-canvas.user.styl) | [Info](kth-canvas) |
| Grammarly | [Install](https://github.com/aruncveli/userstyles/raw/main/grammarly/grammarly.user.styl) | [Info](grammarly) |
12 changes: 1 addition & 11 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
{
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"formatter": {
"enabled": true
},
"linter": {
"enabled": false
},
"organizeImports": {
"enabled": true
},
"files": {
"ignore": ["**/*.user.styl"],
"include": ["sites/**/*.css"]
"ignoreUnknown": true
}
}
Binary file modified bun.lockb
Binary file not shown.
30 changes: 0 additions & 30 deletions eslint.config.js

This file was deleted.

20 changes: 10 additions & 10 deletions generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { renderFile } from "ejs";

const args = argv.slice(2);
if (!args.length) {
throw new Error("Name is required");
throw new Error("Name is required");
}

const name = args.join(" ");
Expand All @@ -18,9 +18,9 @@ console.log(`Creating directory ${smallName}`);
mkdirSync(smallName);

renderFile("readme.ejs", { name, smallName }, (err, str) => {
if (err) throw err;
console.log(`Writing README.md`);
writeFileSync(`${smallName}/README.md`, str);
if (err) throw err;
console.log("Writing README.md");
writeFileSync(`${smallName}/README.md`, str);
});

const getPaddedString = (value: number) => value.toString().padStart(2, "0");
Expand All @@ -32,13 +32,13 @@ const day = getPaddedString(date.getDate());
const version = `${year}.${month}.${day}`;

renderFile("user.styl.ejs", { name, smallName, version }, (err, str) => {
if (err) throw err;
console.log(`Writing ${smallName}.user.styl`);
writeFileSync(`${smallName}/${smallName}.user.styl`, str);
if (err) throw err;
console.log(`Writing ${smallName}.user.styl`);
writeFileSync(`${smallName}/${smallName}.user.styl`, str);
});

renderFile("root-readme-entry.ejs", { name, smallName }, (err, str) => {
if (err) throw err;
console.log(`Writing to README.md`);
appendFileSync(`README.md`, str);
if (err) throw err;
console.log("Writing to README.md");
appendFileSync("README.md", str);
});
4 changes: 1 addition & 3 deletions lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
export default {
"*.{j|t}s": ["eslint --fix"],
"*.*!.user.styl": ["prettier --write"],
"*.user.styl": ["stylelint --fix", "stylelint"],
"*": ["biome check --write", "prettier --write ."],
};
67 changes: 27 additions & 40 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,42 +1,29 @@
{
"name": "userstyles",
"description": "A collection of userstyles for simple and boring dark themes",
"author": "Arun Chandanaveli <aruncveli@gmail.com> (https://github.com/aruncveli)",
"license": "MIT",
"type": "module",
"keywords": [
"userstyles",
"stylus",
"dark-theme"
],
"scripts": {
"compile": "stylus **/*.user.styl",
"format": "biome format --write && prettier --write **/*.md",
"format:check": "biome format && prettier --check **/*.md",
"generate": "bun generate.ts",
"lint": "stylelint **/*.user.styl sites/**/*.css && eslint .",
"lint:fix": "stylelint **/*.user.styl sites/**/*.css --fix && eslint . --fix",
"prepare": "husky"
},
"devDependencies": {
"@eslint/js": "9.18.0",
"@tsconfig/strictest": "2.0.5",
"@types/ejs": "3.1.5",
"@types/eslint-config-prettier": "6.11.3",
"@types/eslint__js": "8.42.3",
"@types/node": "22.10.5",
"@biomejs/biome": "1.9.4",
"ejs": "3.1.10",
"eslint": "9.18.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-simple-import-sort": "12.1.1",
"husky": "9.1.7",
"lint-staged": "15.3.0",
"prettier": "3.4.2",
"stylelint": "16.13.0",
"stylelint-stylus": "1.0.0",
"stylus": "0.64.0",
"typescript": "5.7.3",
"typescript-eslint": "8.19.1"
}
"name": "userstyles",
"description": "A collection of userstyles for simple and boring dark themes",
"author": "Arun Chandanaveli <aruncveli@gmail.com> (https://github.com/aruncveli)",
"license": "MIT",
"type": "module",
"keywords": ["userstyles", "stylus", "dark-theme"],
"scripts": {
"check": "biome check && prettier --check .",
"fix": "biome check --write && prettier --write .",
"generate": "bun generate.ts",
"prepare": "husky"
},
"devDependencies": {
"@biomejs/biome": "1.9.4",
"@eslint/js": "9.18.0",
"@tsconfig/strictest": "2.0.5",
"@types/ejs": "3.1.5",
"@types/node": "22.10.5",
"ejs": "3.1.10",
"husky": "9.1.7",
"lint-staged": "15.3.0",
"stylus": "0.64.0",
"typescript": "5.7.3"
},
"dependencies": {
"prettier": "3.4.2"
}
}
2 changes: 1 addition & 1 deletion prettier.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export default {
proseWrap: "always",
proseWrap: "always",
};
3 changes: 2 additions & 1 deletion sites/archlinux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Dark theme for most of the Arch Linux pages.
For the AUR cgit, dark mode styles from
[cgit homepage](https://git.zx2c4.com/cgit/) are copied as is.

For the Wiki turn on the built-in dark mode or [Wikipedia-Dark](https://github.com/StylishThemes/Wikipedia-Dark).
For the Wiki turn on the built-in dark mode or
[Wikipedia-Dark](https://github.com/StylishThemes/Wikipedia-Dark).

![Screenshot of Arch Linux home page](screenshot.png)
12 changes: 6 additions & 6 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"extends": "@tsconfig/strictest/tsconfig.json",
"compilerOptions": {
"noEmit": true,
"module": "NodeNext",
"moduleResolution": "NodeNext"
}
"extends": "@tsconfig/strictest/tsconfig.json",
"compilerOptions": {
"noEmit": true,
"module": "NodeNext",
"moduleResolution": "NodeNext"
}
}

0 comments on commit abc3cdb

Please sign in to comment.