nextfriday-imports

📁 next-friday/nextfriday-skills 📅 14 days ago
1
总安装量
1
周安装量
#48383
全站排名
安装命令
npx skills add https://github.com/next-friday/nextfriday-skills --skill nextfriday-imports

Agent 安装分布

claude-code 1

Skill 文档

Next Friday Imports

Rules for import statements and module resolution.

Absolute Imports

Disallow relative imports with ../. Use absolute imports instead.

// Bad:
import { Button } from "../../../components/Button";
import { formatDate } from "../../utils/format";

// Good:
import { Button } from "@/components/Button";
import { formatDate } from "@/utils/format";
import { validate } from "./validate"; // sibling import OK

Type Imports

Use import type for type-only imports.

// Bad:
import { ReactNode, FC } from "react";
import { User, Item } from "@/types";

// Good:
import type { ReactNode, FC } from "react";
import type { User, Item } from "@/types";

Date Utilities

Use centralized date utilities (e.g., dayjs) instead of native Date.

// Bad:
const now = new Date();
const timestamp = Date.now();

// Good:
import dayjs from "dayjs";

const now = dayjs();
const timestamp = dayjs().valueOf();

Quick Reference

Rule Pattern
No ../ imports Use absolute paths or @/ alias
Type imports import type { X } for types
Date handling Use dayjs, not native Date