Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[공통] naverpay lint config를 추가합니다. #7

Merged
merged 6 commits into from
Apr 9, 2024
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
65 changes: 65 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/
pnpm-lock.yaml

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# next.js build output
.next

dist

apps/docs/docs

.changeset/*
3 changes: 3 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "@naverpay/eslint-config/front"
}
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

## Request <!-- 리뷰어 분들이 집중적으로 보셨으면 하는 내용 (참고할 내용) -->

-
-
12 changes: 7 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,25 @@ name: CI
on:
pull_request:
branches:
- "**"
- '**'

jobs:
PrettierAndLint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- run: npm i -g pnpm
- run: node -v && pnpm -v
- run: pnpm install --frozen-lockfile
- run: pnpm run prettier
- run: pnpm run lint
TestAndBuild:
- run: pnpm run markdownlint

Test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- run: npm i -g pnpm
- run: node -v && pnpm -v
- run: pnpm install --frozen-lockfile
- run: pnpm run build
- run: pnpm run test
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ jobs:
id: changesets
uses: changesets/action@v1
with:
title: "🚀 version changed packages"
commit: "📦 bump changed packages version"
title: '🚀 version changed packages'
commit: '📦 bump changed packages version'
publish: pnpm release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/size-limit.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "size-limit"
name: 'size-limit'
on:
pull_request:
branches: main
Expand All @@ -12,6 +12,6 @@ jobs:
- uses: actions/checkout@v4
- uses: andresz1/size-limit-action@v1
with:
build_script: "build"
clean_script: "clean"
build_script: 'build'
clean_script: 'clean'
github_token: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "@naverpay/markdown-lint"
}
3 changes: 3 additions & 0 deletions .markdownlintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.changeset
**/CHANGELOG.md
apps/docs/**/*.md
8 changes: 8 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# changeset 제외
.changeset

# markdown 포맷팅은 markdown-lint에게 맡깁니다.
**/*.md

# pnpm lock yaml 제외
pnpm-lock.yaml
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"@naverpay/prettier-config"
20 changes: 10 additions & 10 deletions .size-limit.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
const path = require("path");
const glob = require("glob");
const fs = require("fs");
const path = require('path')
const glob = require('glob')
const fs = require('fs')

const packageJsonList = glob
.globSync("**/package.json", {
cwd: path.join(process.cwd(), "packages"),
.globSync('**/package.json', {
cwd: path.join(process.cwd(), 'packages'),
})
.map((filePath) => {
const { name, main } = JSON.parse(fs.readFileSync(path.join(process.cwd(), "packages", filePath), "utf8"));
const packageName = name.split("/")[1];
const {name, main} = JSON.parse(fs.readFileSync(path.join(process.cwd(), 'packages', filePath), 'utf8'))
const packageName = name.split('/')[1]
return {
name: packageName,
path: `packages/${packageName}${main.slice(1)}`,
};
});
}
})

module.exports = packageJsonList;
module.exports = packageJsonList
20 changes: 13 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@
"scripts": {
"start": "turbo run start",
"build": "turbo run build",
"lint": "turbo run lint",
"lint:fix": "turbo run lint:fix",
"prettier": "turbo run prettier",
"prettier:fix": "turbo run prettier:fix",
"test": "turbo run test",
"lint": "eslint '**/*.{js,jsx,ts,tsx}'",
"lint:fix": "pnpm run lint --fix",
"prettier": "prettier --check '**/*.{json,yaml,md,ts,tsx,js,jsx}'",
"prettier:fix": "prettier --write '**/*.{json,yaml,md,ts,tsx,js,jsx}'",
"markdownlint": "markdownlint '**/*.md' '#.changeset' '#**/CHANGELOG.md'",
"markdownlint:fix": "markdownlint --fix '**/*.md' '#.changeset' '#**/CHANGELOG.md'",
"clean": "turbo run clean && rm -rf ./node_modules && pnpm i",
"release:canary": "pnpm run build && changeset publish --no-git-tag",
"release": "pnpm run build && changeset publish"
Expand All @@ -23,14 +26,17 @@
"**/*.{ts,tsx,js,jsx}": "eslint"
},
"devDependencies": {
"@size-limit/preset-big-lib": "^11.0.2",
"@changesets/cli": "^2.26.2",
"@naverpay/eslint-config": "^0.2.0",
"@naverpay/markdown-lint": "^0.0.2",
"@naverpay/prettier-config": "^0.0.2",
"@size-limit/preset-big-lib": "^11.0.2",
"glob": "^9.3.4",
"husky": "^8.0.3",
"lint-staged": "^15.0.1",
"size-limit": "^11.0.2",
"turbo": "^1.10.16",
"typescript": "^5.2.2",
"glob": "^9.3.4"
"typescript": "^5.2.2"
},
"packageManager": "[email protected]"
}
4 changes: 0 additions & 4 deletions packages/random/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
],
"scripts": {
"build": "tsc --build",
"lint": "eslint '**/*.{js,jsx,ts,tsx}'",
"lint:fix": "eslint '**/*.{js,jsx,ts,tsx}' --fix",
"prettier": "prettier --check '**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md}'",
"prettier:fix": "prettier --write '**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md}'",
"clean": "rm -rf dist"
},
"devDependencies": {},
Expand Down
Loading
Loading