Skip to content

Instantly share code, notes, and snippets.

View dipeshhkc's full-sized avatar
🏠
Working from home

Dipesh KC dipeshhkc

🏠
Working from home
View GitHub Profile
module.exports = {
env: {
browser: true,
es2021: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "sqlite"
url = env("DATABASE_URL")
import { PrismaClient } from "@prisma/client";
let db: PrismaClient;
declare global {
var __db: PrismaClient | undefined;
}
// this is needed because in development we don't want to restart
// the server with every change, but we want to make sure we don't
import { Task } from '.prisma/client';
import { BriefcaseIcon, PlusCircleIcon } from '@heroicons/react/solid';
import { Form, useActionData, useLoaderData, useTransition } from 'remix';
import { action as NewTaskAction, NewTaskActionData } from './api/task/new';
import { loader as TaskLoader } from './api/task/get';
import { useEffect, useRef } from 'react';
export const loader = TaskLoader;
export const action = NewTaskAction;
import { ActionFunction, json, redirect } from 'remix';
import { db } from '~/utils/db.server';
// return type of this action
export type DeleteTaskActionData = {
formError?: string;
fieldErrors?: {
taskId?: string;
};
fields?: {
import { ActionFunction, json } from 'remix';
import { db } from '~/utils/db.server';
// return type of this action
export type NewTaskActionData = {
formError?: string;
fieldErrors?: {
task?: string;
};
fields?: {
import { LoaderFunction } from '@remix-run/server-runtime';
import { db } from '~/utils/db.server';
export const loader: LoaderFunction = async () => {
return db.task.findMany();
};
module.exports = {
content: ["./app/**/*.{ts,tsx}"],
theme: {
extend: {},
},
variants: {
extend: {},
},
plugins: [],
}
import stylesUrl from "~/styles/tailwind.css";
import type { LinksFunction } from "remix";
export const links: LinksFunction = () => {
return [{ rel: "stylesheet", href: stylesUrl }];
};
@import "tailwindcss/base";
@import "tailwindcss/components";
@import "tailwindcss/utilities";
@import "./components/button.css";