From 63345404a67859201ca173895b095730d9679164 Mon Sep 17 00:00:00 2001 From: Reinaldy Rafli Date: Mon, 18 Oct 2021 01:41:15 +0700 Subject: [PATCH] chore: eslint fix --- .eslintrc | 11 +- .github/workflows/ci.yml | 35 +-- .husky/pre-commit | 2 +- components/GetRepositories.ts | 2 +- components/Home/Main.tsx | 3 +- components/Icons.tsx | 20 +- components/Navbar.tsx | 30 +-- components/Project.tsx | 4 +- components/Repository.tsx | 2 +- config/case.ts | 5 +- config/head.ts | 2 +- config/projects.ts | 10 +- package-lock.json | 457 ++++++++++++++++++++++++++++++++++ package.json | 4 +- pages/project/[repo].tsx | 29 ++- types/project.ts | 2 +- vite.config.ts | 2 +- windi.config.ts | 2 +- 18 files changed, 530 insertions(+), 92 deletions(-) diff --git a/.eslintrc b/.eslintrc index 47bfe2d..4b82df3 100644 --- a/.eslintrc +++ b/.eslintrc @@ -5,8 +5,10 @@ }, "extends": [ "xo-space", - "plugin:solid/recommended" + "plugin:solid/recommended", + "plugin:@typescript-eslint/recommended" ], + "parser": "@typescript-eslint/parser", "parserOptions": { "ecmaVersion": 12, "sourceType": "module", @@ -15,10 +17,13 @@ } }, "plugins": [ - "solid" + "solid", + "@typescript-eslint" ], "rules": { "capitalized-comments": ["off"], - "object-curly-spacing": ["error", "always"] + "object-curly-spacing": ["error", "always"], + "camelcase": ["off"], + "solid/no-innerhtml": ["warn"] } } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4a516a9..8e1461d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,18 +2,19 @@ name: Build on: push: - branches: [ "*" ] + branches: + - "*" pull_request: - branches: [ "*" ] + branches: + - "*" jobs: build: name: Build runs-on: ubuntu-latest - + timeout-minutes: 10 strategy: fail-fast: false - steps: - name: Checkout code uses: actions/checkout@master @@ -21,30 +22,16 @@ jobs: - name: Setup nodejs uses: actions/setup-node@v2.1.4 with: - node-version: 14 - - - name: Get yarn cache directory path 🛠 - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" - - - name: Cache node_modules - uses: actions/cache@v2 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- + node-version: 16.x - name: Installling dependencies - if: steps.cache.outputs.cache-hit != 'true' - run: yarn + run: npm install - name: Lint - run: yarn run lint - + run: npx eslint --ext .ts,.tsx,.js,.jsx --ignore-path .gitignore . + - name: Build - run: yarn run generate + run: npm run generate - name: Initialize CodeQL uses: github/codeql-action/init@v1 @@ -52,4 +39,4 @@ jobs: languages: javascript - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 \ No newline at end of file + uses: github/codeql-action/analyze@v1 diff --git a/.husky/pre-commit b/.husky/pre-commit index 20d0d06..8dd5880 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,4 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" -npm run lint +npx eslint --ext .ts,.tsx,.js,.jsx --ignore-path .gitignore . diff --git a/components/GetRepositories.ts b/components/GetRepositories.ts index d41ef25..054c14d 100644 --- a/components/GetRepositories.ts +++ b/components/GetRepositories.ts @@ -1,4 +1,4 @@ -import type { GithubRepository } from "../types/github"; +import { GithubRepository } from '../types/github'; async function getRepositories(): Promise { try { diff --git a/components/Home/Main.tsx b/components/Home/Main.tsx index b20d56e..a4a5a21 100644 --- a/components/Home/Main.tsx +++ b/components/Home/Main.tsx @@ -21,7 +21,6 @@ const link = [ }, ]; - function Home() { return (
@@ -58,7 +57,7 @@ function Home() {
- ) + ); } export default Home; diff --git a/components/Icons.tsx b/components/Icons.tsx index 010e34a..5b2c597 100644 --- a/components/Icons.tsx +++ b/components/Icons.tsx @@ -6,7 +6,7 @@ // All company, product and service names used in this website are for identification purposes only. // Use of these names, logos, and brands does not imply endorsement. -import type { Stack } from '../types/project' +import { Stack } from '../types/project'; interface Props { name: Stack | 'github' | 'arrow-right'; @@ -50,12 +50,6 @@ function Icons(props: Props) { ); - case 'lua': - return ( - - - - ); case 'mongodb': return ( @@ -117,12 +111,6 @@ function Icons(props: Props) { ); - case 'docker': - return ( - - - - ) case 'lua': return ( @@ -132,7 +120,7 @@ function Icons(props: Props) { case 'nextjs': return ( - + ); @@ -145,7 +133,7 @@ function Icons(props: Props) { case 'sentry': return ( - + ); @@ -159,7 +147,7 @@ function Icons(props: Props) { case 'github': return ( - + ); diff --git a/components/Navbar.tsx b/components/Navbar.tsx index 209e76b..388a29e 100644 --- a/components/Navbar.tsx +++ b/components/Navbar.tsx @@ -1,26 +1,20 @@ import { NavLink } from 'solid-app-router'; -import { onMount } from 'solid-js'; function Navbar() { - - onMount(async () => { - - }) - return (
-
- -

Reinaldy Rafli

- My Memoji -
-
-
Projects
- +
+ +

Reinaldy Rafli

+ My Memoji +
+
+
Projects
+ ); } diff --git a/components/Project.tsx b/components/Project.tsx index 9574b48..e17cab3 100644 --- a/components/Project.tsx +++ b/components/Project.tsx @@ -1,6 +1,6 @@ import { For, Show } from 'solid-js'; import Icons from './Icons'; -import type { Project } from "../types/project"; +import { Project } from '../types/project'; import { NavLink } from 'solid-app-router'; import { convertCase } from '../config/case'; @@ -53,7 +53,7 @@ function ProjectCard(project: Project) { - ) + ); } export default ProjectCard; diff --git a/components/Repository.tsx b/components/Repository.tsx index e1d72c3..49446ae 100644 --- a/components/Repository.tsx +++ b/components/Repository.tsx @@ -1,4 +1,4 @@ -import type { GithubLanguage, GithubRepository } from "../types/github"; +import { GithubLanguage } from '../types/github'; const image = { folder: 'folder.svg', diff --git a/config/case.ts b/config/case.ts index 43c693b..7a354a8 100644 --- a/config/case.ts +++ b/config/case.ts @@ -1,6 +1,9 @@ export function convertCase(str: string): string { return str .split(' ') - .reduce((p: string[], c) => { p.push(c.toLowerCase()); return p; }, []) + .reduce((p: string[], c) => { + p.push(c.toLowerCase()); + return p; + }, []) .join('-'); } diff --git a/config/head.ts b/config/head.ts index 3d0cd48..f1a4d9b 100644 --- a/config/head.ts +++ b/config/head.ts @@ -1,4 +1,4 @@ -import type { MetaItem } from "../types/meta"; +import { MetaItem } from '../types/meta'; const config = { title: 'Reinaldy Rafli - Code', diff --git a/config/projects.ts b/config/projects.ts index 91d8b06..dc85c2f 100644 --- a/config/projects.ts +++ b/config/projects.ts @@ -1,4 +1,4 @@ -import type { Project } from "../types/project"; +import { Project } from '../types/project'; const projects: Project[] = [ { @@ -101,7 +101,7 @@ const projects: Project[] = [ description: 'Simple Pastebin clone with POST request support & secure compression', repository: 'https://github.com/teknologi-umum/polarite', website: 'https://polarite.teknologiumum.com', - role: 'author' + role: 'author', }, { id: 12, @@ -138,7 +138,7 @@ const projects: Project[] = [ title: 'SQL DSL', description: 'Mapped SQL query & argument from a template literal', repository: 'https://github.com/aldy505/sql-dsl', - role: 'author' + role: 'author', }, { id: 18, @@ -147,7 +147,7 @@ const projects: Project[] = [ title: 'Sentry Fiber', description: 'Unofficial Fiber handler for Sentry SDK', repository: 'https://github.com/aldy505/sentry-fiber', - role: 'author' + role: 'author', }, { id: 19, @@ -157,7 +157,7 @@ const projects: Project[] = [ description: 'Humans-utils specifically for Indonesian locale', repository: 'https://github.com/teknologi-umum/manusier', role: 'author', - } + }, ]; export default projects; diff --git a/package-lock.json b/package-lock.json index d682923..1eb76f8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,6 +23,8 @@ "@commitlint/cli": "^13.2.1", "@commitlint/config-conventional": "^13.2.0", "@types/marked": "^3.0.1", + "@typescript-eslint/eslint-plugin": "^5.0.0", + "@typescript-eslint/parser": "^5.0.0", "@windicss/plugin-scrollbar": "^1.2.3", "eslint": "^7.32.0", "eslint-config-xo-space": "^0.30.0", @@ -945,6 +947,12 @@ "node": ">= 8" } }, + "node_modules/@types/json-schema": { + "version": "7.0.9", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", + "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==", + "dev": true + }, "node_modules/@types/marked": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/@types/marked/-/marked-3.0.1.tgz", @@ -975,6 +983,199 @@ "integrity": "sha512-5eQEtSCoESnh2FsiLTxE121IiE60hnMqcb435fShf4bpLRjEu1Eoekht23y6zXS9Ts3l+Szu3TARnTsA0GkOkQ==", "dev": true }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.0.0.tgz", + "integrity": "sha512-T6V6fCD2U0YesOedvydTnrNtsC8E+c2QzpawIpDdlaObX0OX5dLo7tLU5c64FhTZvA1Xrdim+cXDI7NPsVx8Cg==", + "dev": true, + "dependencies": { + "@typescript-eslint/experimental-utils": "5.0.0", + "@typescript-eslint/scope-manager": "5.0.0", + "debug": "^4.3.1", + "functional-red-black-tree": "^1.0.1", + "ignore": "^5.1.8", + "regexpp": "^3.1.0", + "semver": "^7.3.5", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^5.0.0", + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/experimental-utils": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-5.0.0.tgz", + "integrity": "sha512-Dnp4dFIsZcPawD6CT1p5NibNUQyGSEz80sULJZkyhyna8AEqArmfwMwJPbmKzWVo4PabqNVzHYlzmcdLQWk+pg==", + "dev": true, + "dependencies": { + "@types/json-schema": "^7.0.7", + "@typescript-eslint/scope-manager": "5.0.0", + "@typescript-eslint/types": "5.0.0", + "@typescript-eslint/typescript-estree": "5.0.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "*" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/experimental-utils/node_modules/eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^2.0.0" + }, + "engines": { + "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=5" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", + "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.0.0.tgz", + "integrity": "sha512-B6D5rmmQ14I1fdzs71eL3DAuvnPHTY/t7rQABrL9BLnx/H51Un8ox1xqYAchs0/V2trcoyxB1lMJLlrwrJCDgw==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "5.0.0", + "@typescript-eslint/types": "5.0.0", + "@typescript-eslint/typescript-estree": "5.0.0", + "debug": "^4.3.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.0.0.tgz", + "integrity": "sha512-5RFjdA/ain/MDUHYXdF173btOKncIrLuBmA9s6FJhzDrRAyVSA+70BHg0/MW6TE+UiKVyRtX91XpVS0gVNwVDQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.0.0", + "@typescript-eslint/visitor-keys": "5.0.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/types": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.0.0.tgz", + "integrity": "sha512-dU/pKBUpehdEqYuvkojmlv0FtHuZnLXFBn16zsDmlFF3LXkOpkAQ2vrKc3BidIIve9EMH2zfTlxqw9XM0fFN5w==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.0.0.tgz", + "integrity": "sha512-V/6w+PPQMhinWKSn+fCiX5jwvd1vRBm7AX7SJQXEGQtwtBvjMPjaU3YTQ1ik2UF1u96X7tsB96HMnulG3eLi9Q==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.0.0", + "@typescript-eslint/visitor-keys": "5.0.0", + "debug": "^4.3.1", + "globby": "^11.0.3", + "is-glob": "^4.0.1", + "semver": "^7.3.5", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.0.0.tgz", + "integrity": "sha512-yRyd2++o/IrJdyHuYMxyFyBhU762MRHQ/bAGQeTnN3pGikfh+nEmM61XTqaDH1XDp53afZ+waXrk0ZvenoZ6xw==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.0.0", + "eslint-visitor-keys": "^3.0.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.0.0.tgz", + "integrity": "sha512-mJOZa35trBTb3IyRmo8xmKBZlxf+N7OnUl4+ZhJHs/r+0770Wh/LEACE2pqMGMe27G/4y8P2bYGk4J70IC5k1Q==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, "node_modules/@windicss/config": { "version": "1.4.11", "resolved": "https://registry.npmjs.org/@windicss/config/-/config-1.4.11.tgz", @@ -1141,6 +1342,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/arrify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", @@ -1599,6 +1809,18 @@ "node": ">=0.3.1" } }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -2568,6 +2790,35 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/globby": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.4.tgz", + "integrity": "sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.1.1", + "ignore": "^5.1.4", + "merge2": "^1.3.0", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globby/node_modules/ignore": { + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", + "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, "node_modules/graceful-fs": { "version": "4.2.8", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz", @@ -4245,6 +4496,15 @@ "integrity": "sha512-KWcOiKeQj6ZyXx7zq4YxSMgHRlod4czeBQZrPb8OKcohcqAXShm7E20kEMle9WBt26hFcAf0qLOcp5zmY7kOqQ==", "dev": true }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/slice-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", @@ -4711,6 +4971,27 @@ "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==", "dev": true }, + "node_modules/tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "dependencies": { + "tslib": "^1.8.1" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + } + }, + "node_modules/tsutils/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -5717,6 +5998,12 @@ "fastq": "^1.6.0" } }, + "@types/json-schema": { + "version": "7.0.9", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", + "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==", + "dev": true + }, "@types/marked": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/@types/marked/-/marked-3.0.1.tgz", @@ -5747,6 +6034,116 @@ "integrity": "sha512-5eQEtSCoESnh2FsiLTxE121IiE60hnMqcb435fShf4bpLRjEu1Eoekht23y6zXS9Ts3l+Szu3TARnTsA0GkOkQ==", "dev": true }, + "@typescript-eslint/eslint-plugin": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.0.0.tgz", + "integrity": "sha512-T6V6fCD2U0YesOedvydTnrNtsC8E+c2QzpawIpDdlaObX0OX5dLo7tLU5c64FhTZvA1Xrdim+cXDI7NPsVx8Cg==", + "dev": true, + "requires": { + "@typescript-eslint/experimental-utils": "5.0.0", + "@typescript-eslint/scope-manager": "5.0.0", + "debug": "^4.3.1", + "functional-red-black-tree": "^1.0.1", + "ignore": "^5.1.8", + "regexpp": "^3.1.0", + "semver": "^7.3.5", + "tsutils": "^3.21.0" + }, + "dependencies": { + "@typescript-eslint/experimental-utils": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-5.0.0.tgz", + "integrity": "sha512-Dnp4dFIsZcPawD6CT1p5NibNUQyGSEz80sULJZkyhyna8AEqArmfwMwJPbmKzWVo4PabqNVzHYlzmcdLQWk+pg==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.7", + "@typescript-eslint/scope-manager": "5.0.0", + "@typescript-eslint/types": "5.0.0", + "@typescript-eslint/typescript-estree": "5.0.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0" + }, + "dependencies": { + "eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^2.0.0" + } + } + } + }, + "ignore": { + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", + "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", + "dev": true + } + } + }, + "@typescript-eslint/parser": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.0.0.tgz", + "integrity": "sha512-B6D5rmmQ14I1fdzs71eL3DAuvnPHTY/t7rQABrL9BLnx/H51Un8ox1xqYAchs0/V2trcoyxB1lMJLlrwrJCDgw==", + "dev": true, + "requires": { + "@typescript-eslint/scope-manager": "5.0.0", + "@typescript-eslint/types": "5.0.0", + "@typescript-eslint/typescript-estree": "5.0.0", + "debug": "^4.3.1" + } + }, + "@typescript-eslint/scope-manager": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.0.0.tgz", + "integrity": "sha512-5RFjdA/ain/MDUHYXdF173btOKncIrLuBmA9s6FJhzDrRAyVSA+70BHg0/MW6TE+UiKVyRtX91XpVS0gVNwVDQ==", + "dev": true, + "requires": { + "@typescript-eslint/types": "5.0.0", + "@typescript-eslint/visitor-keys": "5.0.0" + } + }, + "@typescript-eslint/types": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.0.0.tgz", + "integrity": "sha512-dU/pKBUpehdEqYuvkojmlv0FtHuZnLXFBn16zsDmlFF3LXkOpkAQ2vrKc3BidIIve9EMH2zfTlxqw9XM0fFN5w==", + "dev": true + }, + "@typescript-eslint/typescript-estree": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.0.0.tgz", + "integrity": "sha512-V/6w+PPQMhinWKSn+fCiX5jwvd1vRBm7AX7SJQXEGQtwtBvjMPjaU3YTQ1ik2UF1u96X7tsB96HMnulG3eLi9Q==", + "dev": true, + "requires": { + "@typescript-eslint/types": "5.0.0", + "@typescript-eslint/visitor-keys": "5.0.0", + "debug": "^4.3.1", + "globby": "^11.0.3", + "is-glob": "^4.0.1", + "semver": "^7.3.5", + "tsutils": "^3.21.0" + } + }, + "@typescript-eslint/visitor-keys": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.0.0.tgz", + "integrity": "sha512-yRyd2++o/IrJdyHuYMxyFyBhU762MRHQ/bAGQeTnN3pGikfh+nEmM61XTqaDH1XDp53afZ+waXrk0ZvenoZ6xw==", + "dev": true, + "requires": { + "@typescript-eslint/types": "5.0.0", + "eslint-visitor-keys": "^3.0.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.0.0.tgz", + "integrity": "sha512-mJOZa35trBTb3IyRmo8xmKBZlxf+N7OnUl4+ZhJHs/r+0770Wh/LEACE2pqMGMe27G/4y8P2bYGk4J70IC5k1Q==", + "dev": true + } + } + }, "@windicss/config": { "version": "1.4.11", "resolved": "https://registry.npmjs.org/@windicss/config/-/config-1.4.11.tgz", @@ -5874,6 +6271,12 @@ "is-string": "^1.0.7" } }, + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true + }, "arrify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", @@ -6236,6 +6639,15 @@ "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", "dev": true }, + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "requires": { + "path-type": "^4.0.0" + } + }, "doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -6911,6 +7323,28 @@ "type-fest": "^0.20.2" } }, + "globby": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.4.tgz", + "integrity": "sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==", + "dev": true, + "requires": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.1.1", + "ignore": "^5.1.4", + "merge2": "^1.3.0", + "slash": "^3.0.0" + }, + "dependencies": { + "ignore": { + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", + "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", + "dev": true + } + } + }, "graceful-fs": { "version": "4.2.8", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz", @@ -8095,6 +8529,12 @@ "integrity": "sha512-KWcOiKeQj6ZyXx7zq4YxSMgHRlod4czeBQZrPb8OKcohcqAXShm7E20kEMle9WBt26hFcAf0qLOcp5zmY7kOqQ==", "dev": true }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + }, "slice-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", @@ -8477,6 +8917,23 @@ "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==", "dev": true }, + "tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + } + } + }, "type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", diff --git a/package.json b/package.json index 9bf1d04..8a890f4 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "dev": "vite", "generate": "vite build", - "lint": "eslint --fix --ext .jsx,.js --ignore-path .gitignore .", + "lint": "eslint --fix --ext .ts,.tsx,.js,.jsx --ignore-path .gitignore .", "postinstall": "husky install" }, "repository": { @@ -33,6 +33,8 @@ "@commitlint/cli": "^13.2.1", "@commitlint/config-conventional": "^13.2.0", "@types/marked": "^3.0.1", + "@typescript-eslint/eslint-plugin": "^5.0.0", + "@typescript-eslint/parser": "^5.0.0", "@windicss/plugin-scrollbar": "^1.2.3", "eslint": "^7.32.0", "eslint-config-xo-space": "^0.30.0", diff --git a/pages/project/[repo].tsx b/pages/project/[repo].tsx index 6c3af31..5d71e4d 100644 --- a/pages/project/[repo].tsx +++ b/pages/project/[repo].tsx @@ -1,19 +1,22 @@ -import { useParams } from "solid-app-router"; -import { createSignal, For, onMount, Show } from "solid-js"; +import { useParams } from 'solid-app-router'; +import { createSignal, For, onMount, Show } from 'solid-js'; import marked from 'marked'; -import Navbar from "../../components/Navbar"; -import { convertCase } from "../../config/case"; -import projects from "../../config/projects"; -import { GithubRepository } from "../../types/github"; -import type { Project } from "../../types/project"; +import Navbar from '../../components/Navbar'; +import { convertCase } from '../../config/case'; +import projects from '../../config/projects'; +import { GithubRepository } from '../../types/github'; +import { Project } from '../../types/project'; import 'solid-styled-jsx'; import css from '../../styles/repo.sass'; -import Icons from "../../components/Icons"; +import Icons from '../../components/Icons'; async function fetchData(repo: string): Promise { const findData = projects.find(i => convertCase(i.title) === repo); - if (!findData.repository) return {...findData, details: 'Oops, sorry. Nothing to see here yet.'}; + if (!findData.repository) { + return { ...findData, details: 'Oops, sorry. Nothing to see here yet.' }; + } + const repoPath = findData.repository.replace('https://github.com/', ''); const github = await (await fetch(`https://api.github.com/repos/${repoPath}`)).json() as GithubRepository; const details = await (await fetch(`https://raw.githubusercontent.com/${repoPath}/${github.default_branch}/README.md`)).text(); @@ -21,19 +24,19 @@ async function fetchData(repo: string): Promise { ...findData, github, details, - } + }; } function ProjectRepo() { const params = useParams<{repo: string}>(); - const [data, setData ] = createSignal(); + const [data, setData] = createSignal(); const [requestOk, setRequestOk] = createSignal(false); onMount(async () => { const p = await fetchData(params.repo); setData(p); setRequestOk(true); - }) + }); return (
@@ -55,7 +58,7 @@ function ProjectRepo() {
- ) + ); } export default ProjectRepo; diff --git a/types/project.ts b/types/project.ts index 6cf04eb..a6824b1 100644 --- a/types/project.ts +++ b/types/project.ts @@ -1,4 +1,4 @@ -import type { GithubRepository } from "./github"; +import { GithubRepository } from './github'; export type Stack = 'bootstrap' | diff --git a/vite.config.ts b/vite.config.ts index ed11594..afadaf7 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -16,6 +16,6 @@ export default defineConfig({ target: 'esnext', polyfillDynamicImport: false, emptyOutDir: true, - outDir: 'dist' + outDir: 'dist', }, }); diff --git a/windi.config.ts b/windi.config.ts index f4e2cc2..f1643d3 100644 --- a/windi.config.ts +++ b/windi.config.ts @@ -8,7 +8,7 @@ export default defineConfig({ fontFamily: { display: ['Poppins', 'Inter', 'Roboto', 'sans-serif'], body: ['Poppins', 'Inter', 'Roboto', 'sans-serif'], - code: ['IBM Plex Mono', 'JetBrains Mono', 'SF Mono', 'Consolas', 'monospace'] + code: ['IBM Plex Mono', 'JetBrains Mono', 'SF Mono', 'Consolas', 'monospace'], }, extend: { colors: {