Skip to content

Commit

Permalink
docs: 파일정리
Browse files Browse the repository at this point in the history
  • Loading branch information
dw3624 committed Mar 19, 2024
1 parent adf209a commit f6aa98f
Show file tree
Hide file tree
Showing 30 changed files with 30,831 additions and 0 deletions.
35 changes: 35 additions & 0 deletions next13/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
module.exports = {
env: {
browser: true,
es2021: true
},
extends: ["plugin:react/recommended", "next/core-web-vitals", "prettier", "plugin:storybook/recommended"],
overrides: [],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json']
},
plugins: ['react', 'simple-import-sort', 'import', 'unused-imports'],
rules: {
'react/prop-types': 'off',
// js 사용시 missing in props validation 에러 제거
'simple-import-sort/imports': 'error',
// import문의 sort 규칙 설정
'simple-import-sort/exports': 'error',
// export문의 sort 규칙 설정
'import/first': 'error',
// 모든 import문이 파일 선두에 위치해 있는 것 확인
'import/newline-after-import': 'error',
// import문 아래 빈 줄 확인
'import/no-duplicates': 'error',
// 같은 파일의 import문 머지
'unused-imports/no-unused-imports': 'error' // 미사용 import문 삭제
},

settings: {
react: {
version: 'detect'
}
}
};
35 changes: 35 additions & 0 deletions next13/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
13 changes: 13 additions & 0 deletions next13/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = {
printWidth: 80, // 1行で表示する文字数
tabWidth: 2, // インデントのサイズ
useTabs: false, // インデントにスペースの代わりにタブを使うかどうか
semi: true, // 文の後にセミコロンを付けるかどうか
singleQuote: true, // 文字列をシングルクォートで囲むかどうか(falseだとダブルクォート)
quoteProps: "as-needed", // オブジェクトのプロパティ名をクォートで囲むかどうか
jsxSingleQuote: false, // JSX内のクォートをシングルクォートで囲むかどうか
trailingComma: "es5", // 複数行のときの末尾のカンマを付けるかどうか
bracketSpacing: true, // オブジェクトリテラルの{}内の前後にスペースを入れるかどうか
bracketSameLine: false, // JSX内の要素の閉じタグを最後の行に含んで表示するか
arrowParens: "always", // アロー関数の引数が1つのときにカッコで囲むかどうか
};
1 change: 1 addition & 0 deletions next13/.prettierrcignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.md
55 changes: 55 additions & 0 deletions next13/.scaffdog/component.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
name: 'component'
root: 'src/components'
output: '.'
ignore: []
questions:
name: 'Please enter a component name.'
---

# `{{ inputs.name | pascal }}/{{ inputs.name | pascal }}.tsx`

```typescript
import React from 'react';

import styles from './{{ inputs.name | pascal }}.module.css'

const {{ inputs.name | pascal }} = () => {
return (
<div>
</div>
);
};

export default {{ inputs.name | pascal }};

```

# `{{ inputs.name | pascal }}/{{ inputs.name | pascal }}.module.css`

```css

```

# `{{ inputs.name | pascal }}/{{ inputs.name | pascal }}.stories.ts`

```typescript
import { Meta, StoryObj } from '@storybook/react';
import {{ inputs.name | pascal }} from './{{ inputs.name | pascal }}';

const meta: Meta<typeof {{ inputs.name | pascal }}> = {
title: 'Components/{{ inputs.name | pascal }}',
component: {{ inputs.name | pascal }},
};

export default meta;
type Story = StoryObj<typeof {{ inputs.name | pascal }}>;

export const Primary: Story = {
args: {
type: 'primary',
children: 'Button',
},
};

```
3 changes: 3 additions & 0 deletions next13/.scaffdog/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
files: ['*'],
};
17 changes: 17 additions & 0 deletions next13/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import type { StorybookConfig } from '@storybook/nextjs';
const config: StorybookConfig = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
],
framework: {
name: '@storybook/nextjs',
options: {},
},
docs: {
autodocs: 'tag',
},
};
export default config;
15 changes: 15 additions & 0 deletions next13/.storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type { Preview } from '@storybook/react';

const preview: Preview = {
parameters: {
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
},
};

export default preview;
15 changes: 15 additions & 0 deletions next13/.stylelintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
extends: [
'stylelint-config-recess-order',
'stylelint-config-recommended-scss',
],
rules: {
// ::before, ::after 콜론 2개로 고정
'selector-pseudo-element-colon-notation': 'double',
// 클래스 명에서 & 사용 금지(&:hover 등은 허용)
'scss/selector-no-union-class-name': true,
// 싱글 쿼테이션으로 통일
'string-quotes': 'single',
},
ignoreFiles: ['**/node_modules/**'],
};
16 changes: 16 additions & 0 deletions next13/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.fixAll.stylelint": "explicit"
},
"stylelint.validate": ["css", "scss"],
"css.validate": false,
"scss.validate": false,
"javascript.validate.enable": false,
"typescript.validate.enable": true,

"python.formatting.provider": "black",
"python.formatting.blackArgs": ["--line-length", "100"]
}
Loading

0 comments on commit f6aa98f

Please sign in to comment.