Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# デフォルトですべてのテキストファイルの改行コードをLFに設定
* text=auto eol=lf

# Windowsのバッチファイルは明示的にCRLFを使用
*.bat text eol=crlf
*.cmd text eol=crlf

# バイナリファイルは改行コード変換を行わない
*.png binary
*.jpg binary
*.gif binary
*.ico binary
*.zip binary
*.pdf binary

# プロジェクト特有のファイル設定
# JavaScript/TypeScript関連
*.js text
*.jsx text
*.ts text
*.tsx text
*.json text
*.css text
*.scss text
*.html text

# ドキュメント
*.md text diff=markdown
*.mdx text diff=markdown
*.txt text
*.csv text

# SQLファイル
*.sql text

# シェルスクリプト
*.sh text eol=lf

# huskyスクリプト用の設定
.husky/* text eol=lf

# Font files
*.ttf binary
*.eot binary
*.woff binary
*.woff2 binary

4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
name: 🐛 バグ報告
about: バグの報告や修正依頼
labels: ["bug"]
assignees: ""
labels: ['bug']
assignees: ''
---

## 🐛 バグの概要
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/documentation.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
name: 📚 ドキュメント
about: ドキュメントの追加・更新・修正
labels: ["documentation"]
assignees: ""
labels: ['documentation']
assignees: ''
---

## 📚 更新の概要
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
name: ✨ 機能要望
about: 新機能の提案や機能改善の要望
labels: ["enhancement"]
assignees: ""
labels: ['enhancement']
assignees: ''
---

## ✨ 要望の概要
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/task.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
name: 📋 タスク
about: 一般的なタスクや作業項目
labels: ["task"]
assignees: ""
labels: ['task']
assignees: ''
---

## 📋 タスクの概要
Expand Down
27 changes: 27 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,31 @@ about: プルリクエスト用テンプレート

`Copyテスト結果や確認手順を記載`

## コード品質確認

<!-- コード品質に関するチェック項目です -->

### リントチェック

- [ ] ESLint(JavaScript)チェックをパスした
- [ ] Stylelint(CSS)チェックをパスした
- [ ] HTML Validate(HTML)チェックをパスした

### コード品質基準の順守

- [ ] HTML: DOCTYPEは大文字で記述している
- [ ] HTML: 自己閉じタグは`/>`ではなく`>`形式を使用している
- [ ] JavaScript: 変数・関数名は適切な命名規則に従っている
- [ ] CSS: クラス名は適切な命名規則に従っている
- [ ] 不要なコメントやデバッグコードが残っていない
- [ ] コードの重複や冗長性がない

### パフォーマンス

- [ ] 不必要なDOM操作を最小限に抑えている
- [ ] 適切なイベント処理を行っている(イベントの重複登録がないなど)
- [ ] 巨大なループや再帰処理の最適化を行っている

## レビューポイント

<!-- 特にレビューしてほしい点を記載してください -->
Expand Down Expand Up @@ -101,6 +126,8 @@ about: プルリクエスト用テンプレート
- [ ] ドキュメントを更新した
- [ ] リファクタリングを行った(不要なコードの削除、命名の改善など)
- [ ] ブランチのマージ先が正しい
- [ ] コード品質チェックツール(ESLint, Stylelint, HTML Validate)をすべてパスした
- [ ] Prettierによるコードフォーマットを適用した

# 備考

Expand Down
87 changes: 29 additions & 58 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Code Quality Check

on:
push:
branches: [ main, master ]
branches: ['main']
pull_request:
branches: [ main, master ]
branches: ['main']
workflow_dispatch:

jobs:
Expand All @@ -14,77 +14,48 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '16'
node-version: '20'
cache: 'npm'

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- name: Install dependencies
run: |
npm init -y
npm install eslint stylelint stylelint-config-standard html-validate --save-dev
run: npm ci

- name: Create ESLint config
- name: Create ESLint config if not exists
run: |
echo '{
"env": {
"browser": true,
"es2021": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 12
},
"rules": {
"no-unused-vars": "warn",
"no-undef": "error",
"semi": ["error", "always"],
"indent": ["error", 2]
}
}' > .eslintrc.json
if [ ! -f eslint.config.js ]; then
echo "module.exports = { extends: ['eslint:recommended', 'plugin:prettier/recommended'], env: { browser: true, es2022: true }, parserOptions: { sourceType: 'module', ecmaVersion: 2022 }, rules: { 'no-unused-vars': 'warn', 'no-undef': 'error', 'semi': ['error', 'always'], 'indent': ['error', 2] } };" > eslint.config.js
fi

- name: Create Stylelint config
- name: Create Stylelint config if not exists
run: |
echo '{
"extends": "stylelint-config-standard",
"rules": {
"indentation": 2,
"color-hex-case": "lower",
"color-hex-length": "short"
}
}' > .stylelintrc.json
if [ ! -f .stylelintrc.json ]; then
echo '{ "extends": "stylelint-config-standard", "rules": { "indentation": 2, "color-hex-case": "lower", "color-hex-length": "short" } }' > .stylelintrc.json
fi

- name: Create HTML Validate config
- name: Create HTML Validate config if not exists
run: |
echo '{
"extends": ["html-validate:recommended"],
"rules": {
"element-required-attributes": "error",
"void-style": "off"
}
}' > .htmlvalidate.json
if [ ! -f .htmlvalidate.json ]; then
echo '{ "extends": ["html-validate:recommended"], "rules": { "element-required-attributes": "error", "void-style": "off", "doctype-style": "uppercase" } }' > .htmlvalidate.json
fi

- name: Lint JavaScript
run: npx eslint '*.js'
run: npm run lint:js

- name: Lint CSS
run: npx stylelint '*.css'
run: npm run lint:css

- name: Validate HTML
run: npx html-validate '*.html'

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install yamllint
run: pip install yamllint

- name: Lint YAML files
run: |
# インラインでYAMLファイルをチェック(設定ファイルを作成せずに直接ルールを指定)
yamllint -d "{extends: relaxed, rules: {indentation: {spaces: 2, indent-sequences: true}, line-length: disable, document-start: disable}}" .
run: npm run lint:html
42 changes: 42 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/versions

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

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

# env files (can opt-in for committing if needed)
.env
.env.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
6 changes: 6 additions & 0 deletions .htmlvalidate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"rules": {
"void-style": "off",
"doctype-style": "off"
}
}
3 changes: 3 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# コード整形とリントを実行
npm run format
npm run lint
16 changes: 16 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"printWidth": 100,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"quoteProps": "as-needed",
"jsxSingleQuote": false,
"trailingComma": "es5",
"bracketSpacing": true,
"bracketSameLine": false,
"arrowParens": "avoid",
"htmlWhitespaceSensitivity": "css",
"vueIndentScriptAndStyle": false,
"endOfLine": "lf"
}
6 changes: 6 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "stylelint-config-standard",
"rules": {
"color-hex-length": "short"
}
}
5 changes: 1 addition & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{
"cSpell.words": [
"Marosuke",
"reversi"
]
"cSpell.words": ["htmlhint", "htmlvalidate", "Marosuke", "reversi", "reversicoding"]
}
Loading