diff --git a/.eslintrc.cjs b/.eslintrc.cjs new file mode 100644 index 0000000..a1cc7f7 --- /dev/null +++ b/.eslintrc.cjs @@ -0,0 +1,50 @@ +module.exports = { + env: { + browser: true, + es2021: true + }, + extends: [ + 'eslint:recommended', + 'standard-with-typescript', + 'plugin:@typescript-eslint/recommended', + 'plugin:react/recommended' + ], + overrides: [ + { + env: { + node: true + }, + files: [ + '.eslintrc.{js,cjs}' + ], + parserOptions: { + sourceType: 'script' + } + } + ], + parser: '@typescript-eslint/parser', + parserOptions: { + ecmaVersion: 'latest', + sourceType: 'module', + project: [ + './tsconfig.json' + ] + }, + plugins: [ + 'react', + '@typescript-eslint' + ], + rules: { + 'InferGetStaticPropsType': 'wanr', + 'space-before-function-paren': 'off', + '@typescript-eslint/space-before-function-paren': 'off', + '@typescript-eslint/strict-boolean-expressions': [ + 2, + { + allowString: false, + allowNumber: false + } + ] + }, + ignorePatterns: ['src/**/*.test.ts', 'src/frontend/generated/*'] +} diff --git a/bun.lockb b/bun.lockb index 6380924..8d67b44 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/components/Project.tsx b/components/ListItem.tsx similarity index 53% rename from components/Project.tsx rename to components/ListItem.tsx index 611ed5e..1e3be28 100644 --- a/components/Project.tsx +++ b/components/ListItem.tsx @@ -1,18 +1,18 @@ import ExternalLinkIcon from "./ExternalLinkIcon"; -export interface ProjectProps { +export interface ListItemProps { label: string - date: string + date?: string url: string } -export default function Project({ label, date, url }: ProjectProps) { +export default function ListItem({ label, date, url }: ListItemProps) { return ( -
+

{label}

- {date} + {!!date && {date}} diff --git a/components/MDContent.tsx b/components/MDContent.tsx index bb432e3..6ee1d16 100644 --- a/components/MDContent.tsx +++ b/components/MDContent.tsx @@ -30,20 +30,11 @@ function BackLinks({ linkList }) { interface MDContentProps { - content: unknown + content: string backLinks: unknown[] - handleOpenNewContent: (arg?: unknown) => void } -function MDContent({ content, backLinks, handleOpenNewContent }: MDContentProps) { - - function _handleInternalLinkClick() { - //Processing fetching - //pass result up to parent container - //TODO: handle clicking on internal link, go fetching md content from file then passing it up to parent - handleOpenNewContent(content) - } - +function MDContent({ content, backLinks }: MDContentProps) { useRouter(); return ( diff --git a/components/SocialLinks/SocialLink.js b/components/SocialLinks/SocialLink.js index fda7943..334ee24 100644 --- a/components/SocialLinks/SocialLink.js +++ b/components/SocialLinks/SocialLink.js @@ -1,6 +1,6 @@ export function SocialLink({ SvgElement, link = "#" }) { return ( -
  • +
  • {SvgElement} diff --git a/components/SocialLinks/SocialLinks.js b/components/SocialLinks/SocialLinks.js index b2c1bef..4fd2231 100644 --- a/components/SocialLinks/SocialLinks.js +++ b/components/SocialLinks/SocialLinks.js @@ -1,13 +1,14 @@ import { SocialLink } from "./SocialLink" export function SocialLinksList() { + const width = 24 return (
      - } /> - } /> - } /> - } /> - } /> + } /> + } /> + } /> + } /> + } />
    ) } diff --git a/components/UsefulLinks/UsefulLink.js b/components/UsefulLinks/UsefulLink.js index b783488..33a20ad 100644 --- a/components/UsefulLinks/UsefulLink.js +++ b/components/UsefulLinks/UsefulLink.js @@ -2,10 +2,10 @@ import ExternalLinkIcon from "../ExternalLinkIcon.js"; export function UsefulLink({ title, link }) { return ( - +
  • {title}
    -
    +
  • diff --git a/components/UsefulLinks/UsefulLinks.js b/components/UsefulLinks/UsefulLinks.js index b165d8f..90e7b55 100644 --- a/components/UsefulLinks/UsefulLinks.js +++ b/components/UsefulLinks/UsefulLinks.js @@ -1,8 +1,10 @@ +import ListItem from "../ListItem" import { UsefulLink } from "./UsefulLink" export function UsefulLinksList() { return (
      + diff --git a/next-env.d.ts b/next-env.d.ts index 4f11a03..f557b4e 100644 --- a/next-env.d.ts +++ b/next-env.d.ts @@ -1,4 +1,6 @@ +// eslint-disable-next-line @typescript-eslint/triple-slash-reference /// +// eslint-disable-next-line @typescript-eslint/triple-slash-reference /// // NOTE: This file should not be edited diff --git a/next.config.js b/next.config.js deleted file mode 100644 index fc871fc..0000000 --- a/next.config.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - webpack: (config) => { - config.resolve.fallback = { ...config.resolve.fallback, fs: false }; - return config; - }, -} diff --git a/next.config.ts b/next.config.ts new file mode 100644 index 0000000..8a72074 --- /dev/null +++ b/next.config.ts @@ -0,0 +1,4 @@ +export default function webpack(config: { resolve: { fallback: Record } }): { resolve: { fallback: Record } } { + config.resolve.fallback = { ...config.resolve.fallback, fs: false } + return config +} diff --git a/package.json b/package.json index 2a38f76..e2f1a99 100644 --- a/package.json +++ b/package.json @@ -19,10 +19,16 @@ "@mui/material": "latest", "@mui/x-tree-view": "^6.17.0", "@types/node": "^20.10.5", + "@typescript-eslint/eslint-plugin": "^6.4.0", "cytoscape-d3-force": "latest", "cytoscape-node-html-label": "latest", "d3": "latest", "directory-tree": "latest", + "eslint-config-standard-with-typescript": "latest", + "eslint-plugin-import": "^2.25.2", + "eslint-plugin-n": "^16.0.0", + "eslint-plugin-promise": "^6.0.0", + "eslint-plugin-react": "latest", "fs": "latest", "gray-matter": "latest", "jsnetworkx": "latest", @@ -55,18 +61,24 @@ "autoprefixer": "^10.4.16", "bimap": "latest", "cytoscape": "latest", - "eslint": "latest", + "eslint": "^8.0.1", "eslint-config-next": "latest", "postcss": "^8.4.32", "remark-frontmatter": "latest", "remark-react": "latest", "remark-stringify": "latest", "tailwindcss": "latest", - "uuid": "latest" + "uuid": "latest", + "bun-types": "latest" }, "resolutions": { "react": "^18", "react-dom": "^18", "next": "^14" + }, + "module": "index.ts", + "type": "module", + "peerDependencies": { + "typescript": "^5.0.0" } -} +} \ No newline at end of file diff --git a/pages/index.tsx b/pages/index.tsx index 1e09827..33d13be 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -1,10 +1,11 @@ -import Job, { type JobProps } from "../components/Job"; -import Skill, { type SkillProps } from "../components/Skill"; -import Project, { type ProjectProps } from "../components/Project"; -import Head from "next/head"; +import Job, { type JobProps } from '../components/Job' +import Skill, { type SkillProps } from '../components/Skill' +import ListItem, { type ListItemProps } from '../components/ListItem' +import Head from 'next/head' import { UsefulLinksList } from '../components/UsefulLinks/index' import { SocialLinksList } from '../components/SocialLinks/SocialLinks' -import type { InferGetStaticPropsType, GetStaticProps } from 'next' +import type { GetStaticProps } from 'next' +import { type HTMLAttributes } from 'react' interface LandingProps { jobs: JobsType[] @@ -16,24 +17,24 @@ export default function Landing({ jobs, skills, projects }: LandingProps) { return (
      - + -
      -
      - ); - + ) } - export function getStaticProps(): ReturnType> { return { props: { projects: [ - { label: "Web Window Manager", date: "9/18/2022", url: "https://github.com/tristonarmstrong/web-window-manager" }, - { label: "Component Test Helper", date: "6/18/2022", url: "https://github.com/tristonarmstrong/component-test-helper" }, - { label: "Hive DAPP", date: "3/8/2022", url: "https://github.com/tristonarmstrong/hive-dapp" }, - { label: "Kivy Twisted Input Capture", date: "6/27/2021", url: "https://github.com/tristonarmstrong/KivyTwistedInputCapture" }, - { label: "Plant Monitor Node MCU", date: "6/27/2021", url: "https://github.com/tristonarmstrong/PlantMonitorNodeMCU" }, - { label: "Oppo BDP 103 CLI", date: "4/10/2021", url: "https://github.com/tristonarmstrong/oppo_bdp_103_CLI" }, - { label: "Sony Bravia Pro Server", date: "4/10/2021", url: "https://github.com/tristonarmstrong/sony_bravia_pro_display_mock_server" }, - { label: "Chat IO", date: "6/10/2020", url: "https://github.com/tristonarmstrong/chat.io" }, - { label: "Solar Battery Monitor API", date: "7/18/2023", url: "https://github.com/tristonarmstrong/SolarBatteryMonitorApi" }, - { label: "Zip Code Distance App", date: "1/28/2020", url: "https://github.com/tristonarmstrong/zipapp" }, - { label: "Armstrong Editor", date: "12/14/2022", url: "https://github.com/tristonarmstrong/armstrong-editor" }, + { label: 'Web Window Manager', date: '9/18/2022', url: 'https://github.com/tristonarmstrong/web-window-manager' }, + { label: 'Component Test Helper', date: '6/18/2022', url: 'https://github.com/tristonarmstrong/component-test-helper' }, + { label: 'Hive DAPP', date: '3/8/2022', url: 'https://github.com/tristonarmstrong/hive-dapp' }, + { label: 'Kivy Twisted Input Capture', date: '6/27/2021', url: 'https://github.com/tristonarmstrong/KivyTwistedInputCapture' }, + { label: 'Plant Monitor Node MCU', date: '6/27/2021', url: 'https://github.com/tristonarmstrong/PlantMonitorNodeMCU' }, + { label: 'Oppo BDP 103 CLI', date: '4/10/2021', url: 'https://github.com/tristonarmstrong/oppo_bdp_103_CLI' }, + { label: 'Sony Bravia Pro Server', date: '4/10/2021', url: 'https://github.com/tristonarmstrong/sony_bravia_pro_display_mock_server' }, + { label: 'Chat IO', date: '6/10/2020', url: 'https://github.com/tristonarmstrong/chat.io' }, + { label: 'Solar Battery Monitor API', date: '7/18/2023', url: 'https://github.com/tristonarmstrong/SolarBatteryMonitorApi' }, + { label: 'Zip Code Distance App', date: '1/28/2020', url: 'https://github.com/tristonarmstrong/zipapp' }, + { label: 'Armstrong Editor', date: '12/14/2022', url: 'https://github.com/tristonarmstrong/armstrong-editor' } ], skills: [ - { label: "Typescript" }, - { label: "Python" }, - { label: "Rust" }, - { label: "Javascript" }, + { label: 'Typescript' }, + { label: 'Python' }, + { label: 'Rust' }, + { label: 'Javascript' } ], jobs: [ { logo: 'https://ventrahealth.com/wp-content/uploads/2023/08/cropped-Ventra-Health-favicon-circle-192x192.png', name: 'Ventra Health', details: 'Maintaining and iterating on an internal web application', - dateFrom: "May 2023", - dateTo: "Present" + dateFrom: 'May 2023', + dateTo: 'Present' }, { logo: 'https://www.randstadusa.com/themes/custom/bluex/favicon.ico', name: 'Randstad Technologies', details: 'Built Web Applications for external clients', - dateFrom: "May 2022", - dateTo: "May 2023" + dateFrom: 'May 2022', + dateTo: 'May 2023' }, { logo: 'https://img1.wsimg.com/isteam/ip/9ba626a3-41c9-4092-90b5-cb351983b726/favicon/a8beec51-e35d-4cca-8e88-befa12f687b0.png/:/rs=w:64,h:64,m', name: 'Damiano Global Corporation', details: 'Built Web Applications for external clients', - dateFrom: "July 2020", - dateTo: "Nov 2021" + dateFrom: 'July 2020', + dateTo: 'Nov 2021' }, { logo: '#', name: 'Makers Ladder LLC', details: 'Did some thangs', - dateFrom: "Dec 2019", - dateTo: "Apr 2022" + dateFrom: 'Dec 2019', + dateTo: 'Apr 2022' - }, + } ] - }, + } } } - type SkillsType = SkillProps type JobsType = JobProps -type ProjectsType = ProjectProps +type ProjectsType = ListItemProps + +function Border({ className }: { className: HTMLAttributes['className'] }) { + return ( +
      + ) +} diff --git a/pages/notes/[id].tsx b/pages/notes/[id].tsx index fe25eda..3210bdb 100644 --- a/pages/notes/[id].tsx +++ b/pages/notes/[id].tsx @@ -18,7 +18,6 @@ export default function Home({ note, backLinks, fileNames, tree, flattenNodes })
    - ); } @@ -41,14 +40,14 @@ export function getStaticProps({ params }) { const flattenNodes = Util.getFlattenArray(tree) const listOfEdges: unknown[] = edges.filter(anEdge => anEdge.target === params.id) - const internalLinks: unknown[] = listOfEdges.map(anEdge => nodes.find(aNode => aNode.slug === anEdge.source)).filter(element => element !== undefined) + const internalLinks: unknown[] = listOfEdges.map((anEdge: { source: string }) => nodes.find(aNode => aNode.slug === anEdge.source)).filter(element => element !== undefined) const backLinks = [...new Set(internalLinks)] return { props: { note, tree: tree, flattenNodes: flattenNodes, - backLinks: backLinks.filter((link: Array) => link.slug !== params.id), + backLinks: backLinks.filter((link: { slug: string }) => link.slug !== params.id), }, }; } diff --git a/postcss.config.js b/postcss.config.js index 33ad091..f305d3c 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -1,6 +1,4 @@ -module.exports = { - plugins: { - tailwindcss: {}, - autoprefixer: {}, - }, +export const plugins = { + tailwindcss: {}, + autoprefixer: {} } diff --git a/tailwind.config.js b/tailwind.config.js index b359bbd..2465c84 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,19 +1,16 @@ /** @type {import('tailwindcss').Config} */ -const defaultTheme = require('tailwindcss/defaultTheme') +import defaultTheme, { fontFamily as _fontFamily } from 'tailwindcss/defaultTheme' -module.exports = { - content: [ - "./pages/**/*.{js,ts,jsx,tsx,mdx}", - "./components/**/*.{js,ts,jsx,tsx,mdx}", - ], - theme: { - ...defaultTheme, - extend: { - fontFamily: { - sans: ['Inter var', ...defaultTheme.fontFamily.sans], - }, - }, - }, - plugins: [], +export const content = [ + './pages/**/*.{js,ts,jsx,tsx,mdx}', + './components/**/*.{js,ts,jsx,tsx,mdx}' +] +export const theme = { + ...defaultTheme, + extend: { + fontFamily: { + sans: ['Inter var', ..._fontFamily.sans] + } + } } - +export const plugins = [] diff --git a/tsconfig.json b/tsconfig.json index a2570c1..a5b718d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,6 +8,7 @@ ], "allowJs": true, "skipLibCheck": true, + "strictNullChecks": true, "strict": false, "noEmit": true, "incremental": true, @@ -20,10 +21,16 @@ }, "include": [ "next-env.d.ts", - "**/*.ts", - "**/*.tsx" + "pages/**/*", + "lib/**/*", + "components/**/*", + ".eslintrc.js", + ".eslintrc.cjs", + "*.config.js", + "*.config.ts", ], "exclude": [ - "node_modules" + "node_modules", + "notes/**/*" ] }