-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from hatsu38/feature/add-linter
LinterとCIを導入
- Loading branch information
Showing
18 changed files
with
519 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,119 @@ | ||
{ | ||
"extends": "next/core-web-vitals" | ||
"extends": [ | ||
"next/core-web-vitals", | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/eslint-recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:react/recommended", | ||
"plugin:react-hooks/recommended", | ||
"plugin:jsx-a11y/recommended", | ||
"prettier" | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": ["import"], | ||
"settings": { | ||
"react": { | ||
"version": "detect" | ||
}, | ||
"import/extensions": [".ts", ".tsx", ".js", ".jsx"] | ||
}, | ||
"rules": { | ||
"react/react-in-jsx-scope": "off", // Reactのimportを不要にする | ||
"eqeqeq": [2, "smart"], // ===にする | ||
"quotes": ["error", "double"], // ダブルオーテーションで文字列を囲う | ||
"semi": ["error", "always"], // セミコロンを必須にする | ||
"prefer-const": "error", // 再代入を行わない変数はconstを利用 | ||
"no-var": "error", // var禁止 | ||
"no-debugger": "error", // デバッガーは残さない | ||
"react/button-has-type": "error", // buttonにtypeを必須にする | ||
// 未使用の値はエラーにする | ||
"@typescript-eslint/no-unused-vars": [ | ||
"error", | ||
{ "varsIgnorePattern": "^_", "argsIgnorePattern": "^_" } // ただし _hoge などはok | ||
], | ||
"jsx-a11y/no-static-element-interactions": "off", // divにonClickをつけることを許可 | ||
"jsx-a11y/click-events-have-key-events": "off", // divにonClickをつけることを許可 | ||
// import禁止のルール | ||
"no-restricted-imports": [ | ||
"error", | ||
{ | ||
"name": "aws-amplify", | ||
"message": "Use `@contracter/libs/aws` instead." | ||
} | ||
], | ||
"import/order": [ | ||
"error", | ||
{ | ||
"groups": [ | ||
"builtin", | ||
"external", | ||
"internal", | ||
["parent", "sibling"], | ||
"index", | ||
"object", | ||
"type" | ||
], | ||
"newlines-between": "always", | ||
"pathGroupsExcludedImportTypes": ["builtin", "object"], | ||
"alphabetize": { "order": "asc", "caseInsensitive": true }, | ||
"pathGroups": [ | ||
{ | ||
"pattern": "{react}", | ||
"group": "builtin", | ||
"position": "before" | ||
}, | ||
{ | ||
"pattern": "{next,next/**}", | ||
"group": "external", | ||
"position": "after" | ||
}, | ||
{ | ||
"pattern": "{@contracter/src/libs/**,@contracter/src/libs}", | ||
"group": "external", | ||
"position": "after" | ||
}, | ||
{ | ||
"pattern": "{@contracter/src/utils/**,@contracter/src/utils}", | ||
"group": "external", | ||
"position": "after" | ||
}, | ||
{ | ||
"pattern": "{@contracter/src/apis/**,@contracter/src/apis}", | ||
"group": "external", | ||
"position": "after" | ||
}, | ||
{ | ||
"pattern": "{@contracter/src/models/**,@contracter/src/models}", | ||
"group": "external", | ||
"position": "after" | ||
}, | ||
{ | ||
"pattern": "{@contracter/src/hooks/**,@contracter/src/hooks}", | ||
"group": "internal", | ||
"position": "before" | ||
}, | ||
{ | ||
"pattern": "@contracter/components/**", | ||
"group": "internal", | ||
"position": "before" | ||
}, | ||
{ | ||
"pattern": "{@contracter/src/config/**,@contracter/src/config}", | ||
"group": "index", | ||
"position": "after" | ||
}, | ||
{ | ||
"pattern": "{@contracter/src/domains/**,@contracter/src/domains}", | ||
"group": "type", | ||
"position": "before" | ||
}, | ||
{ | ||
"pattern": "{@contracter/src/constants/**,@contracter/src/constants}", | ||
"group": "type", | ||
"position": "after" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
## 📋 概要 | ||
|
||
## 👓 関連PR | ||
|
||
## 📮 レビュワーに伝えたいこと | ||
<!-- 観点、ポイント、不明点、疑問点など --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: npm | ||
directory: / | ||
schedule: | ||
interval: daily | ||
time: "09:00" | ||
timezone: Asia/Tokyo | ||
reviewers: | ||
- hatsu38 | ||
open-pull-requests-limit: 10 | ||
- package-ecosystem: github-actions | ||
directory: / | ||
schedule: | ||
interval: daily | ||
time: "09:00" | ||
timezone: Asia/Tokyo | ||
reviewers: | ||
- hatsu38 | ||
open-pull-requests-limit: 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name-template: 'v$RESOLVED_VERSION 🌈' | ||
tag-template: 'v$RESOLVED_VERSION' | ||
categories: | ||
- title: '🚀 Features' | ||
labels: | ||
- 'feature' | ||
- title: '🐛 Bug Fixes' | ||
labels: | ||
- 'fix' | ||
- 'bugfix' | ||
- 'bug' | ||
- title: '🔧 Refactoring' | ||
label: 'refactor' | ||
branch: | ||
- '/refactor\/.+/' | ||
- title: '📖 Documentation' | ||
label: 'docs' | ||
branch: | ||
- '/docs\/.+/' | ||
- title: '⛓️ Dependency update' | ||
label: 'dependencies' | ||
- title: '🧰 Maintenance' | ||
label: 'chore' | ||
|
||
change-template: '- $TITLE @$AUTHOR (#$NUMBER)' | ||
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks. | ||
version-resolver: | ||
major: | ||
labels: | ||
- 'major' | ||
minor: | ||
labels: | ||
- 'minor' | ||
patch: | ||
labels: | ||
- 'patch' | ||
default: patch | ||
template: | | ||
## Changes | ||
$CHANGES | ||
autolabeler: | ||
- label: feature | ||
branch: | ||
- '/^feat(ure)?[/-].+/' | ||
- label: bug | ||
branch: | ||
- '/^fix[/-].+/' | ||
- label: chore | ||
branch: | ||
- '/^chore[/-].+/' | ||
- label: refactor | ||
branch: | ||
- '/(refactor|refactoring)[/-].+/' | ||
- label: documentation | ||
branch: | ||
- '/docs[/-].+/' | ||
files: | ||
- '*.md' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Assign Auto | ||
|
||
on: | ||
pull_request: | ||
types: [opened] | ||
|
||
jobs: | ||
assign: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Set assignees | ||
run: gh pr edit $NUMBER --add-assignee $ASSIGNEE | ||
if: github.actor != 'dependabot[bot]' | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
GH_REPO: ${{ github.repository }} | ||
NUMBER: ${{ github.event.pull_request.number }} | ||
ASSIGNEE: ${{ github.actor }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- develop | ||
- main | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Use Node.js 18.x | ||
uses: actions/setup-node@v3.6.0 | ||
with: | ||
node-version: 18.x | ||
cache: npm | ||
|
||
- name: Create dot env file | ||
run: | | ||
touch .env | ||
- name: Install | ||
run: npm ci --prefer-offline --no-audit --no-optional | ||
env: | ||
CI: true | ||
|
||
- name: Build | ||
run: npm run build | ||
|
||
- name: Lint | ||
run: npm run lint . | ||
|
||
- name: Format Check | ||
run: npm run format:check . | ||
|
||
- name: Type Check | ||
run: npm run type:check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Release Drafter | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
update_release_draft: | ||
permissions: | ||
contents: write # for release-drafter/release-drafter to create a github release | ||
pull-requests: write # for release-drafter/release-drafter to add label to PR | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: release-drafter/release-drafter@v5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Ignore artifacts: | ||
build | ||
dist | ||
coverage | ||
.github | ||
.codeclimate.yml | ||
*.md | ||
.env | ||
.next | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"printWidth": 80, | ||
"trailingComma": "es5", | ||
"semi": true, | ||
"singleQuote": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = { | ||
reactStrictMode: true, | ||
} | ||
}; | ||
|
||
module.exports = nextConfig | ||
module.exports = nextConfig; |
Oops, something went wrong.