Git Product home page Git Product logo

next-io-ghent-starter's People

Contributors

dependabot[bot] avatar ioulian avatar timdujardin avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

next-io-ghent-starter's Issues

Add eslint rules

Add styled props helper

import { ComponentProps } from "react";
import {
StyledComponentInnerComponent,
StyledComponentInnerOtherProps,
AnyStyledComponent,
StyledComponentPropsWithRef,
} from "styled-components";

export type inferStyledTypes = ComponentProps<
StyledComponentInnerComponent

&
StyledComponentInnerOtherProps &
StyledComponentPropsWithRef;

Add typing for the i18n next labels

It's possible to add typechecking for the i18n labels. You just need to define which files that should be used for type checking.
Example: mijnenergie-kbc
In mijnenergie-kbc I also added a node script which checks if the translation files aren't missing any keys. This script is currently for just 2 languages but could be easily expanded based on the needs.

Update eslint json

{
  "extends": "next/core-web-vitals",
  "settings": {
    "next": {
      "rootDir": "packages/visitor-app/"
    }
  },
  "rules": {
    "import/order": ["error", {
      "groups": ["builtin", "external", "internal", "parent", "sibling", "index"],
      "pathGroups": [
        {
          "pattern": "@common/**",
          "group": "internal",
          "position": "after"
        },
        {
          "pattern": "@WBTypes/**",
          "group": "internal",
          "position": "before"
        }
      ],
      "newlines-between": "always",
      "pathGroupsExcludedImportTypes": ["builtin"]
    }]
  }
}

And fix code then

I configured some handy user snippets to generate functional, styled and story(book) component (VS Code)

Functional component

{
  "React Functional Component": {
    "prefix": ["rfc"],
    "body": [
      "import { FC } from \"react\";",
      "",
      "import { InferComponentProps } from \"@/types/styled\";",
      "",
      "import { Styled$TM_FILENAME_BASE } from \"./$TM_FILENAME_BASE.styles\";",
      "",
      "const $TM_FILENAME_BASE: FC<InferComponentProps<typeof Styled$TM_FILENAME_BASE>> = ({children, ...props}) => {",
      "  return (",
      "    <Styled$TM_FILENAME_BASE {...props}>",
      "      {children}$2",
      "    </Styled$TM_FILENAME_BASE>",
      "  )",
      "};",
      "",
      "export default $TM_FILENAME_BASE",
      ""
    ],
    "description": "React Functional Component (styled)"
  }
}

Styled Component

{
  "React Styled Component": {
    "prefix": ["rsc"],
    "body": [
      "import styled from \"styled-components\";",
      "",
      "export const Styled${TM_FILENAME_BASE/.styles$//g} = styled.$2``",
      ""
    ],
    "description": "React Styled Component"
  }
}

Story component

{
  "React Stories Component": {
    "prefix": ["rstc"],
    "body": [
      "import type { Meta, StoryObj } from \"@storybook/react\";",
      "",
      "import ${TM_FILENAME_BASE/.stories$//g} from \"./${TM_FILENAME_BASE/.stories$//g}\";",
      "",
      "const meta: Meta<typeof ${TM_FILENAME_BASE/.stories$//g}> = {",
      "  title: \"UI/${TM_FILENAME_BASE/.stories$//g}\",",
      "  component: ${TM_FILENAME_BASE/.stories$//g},",
      "  tags: [\"autodocs\"],",
      "};",
      "",
      "export default meta;",
      "type Story = StoryObj<typeof ${TM_FILENAME_BASE/.stories$//g}>;",
      "",
      "export const Default: Story = {",
      "  args: {",
      "    children: \"${TM_FILENAME_BASE/.stories$//g}\",",
      "  },",
      "};",
      ""
    ],
    "description": "React Stories Component"
  }
}

Moves pages to app/

Roadmap:

Critical:

Can wait

  • Bundle analyser -> should work
  • Auth
  • Data loading helpers + useSWR

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.