-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 223dc1d
Showing
27 changed files
with
4,667 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { rules as defaultRules } from '@commitlint/config-conventional'; | ||
|
||
/** | ||
* Commit Lint Config | ||
*/ | ||
const commitLintConfig = { | ||
extends: ['@commitlint/config-conventional'], | ||
helpUrl: '', | ||
plugins: ['commitlint-plugin-function-rules'], | ||
rules: { | ||
...defaultRules, | ||
'function-rules/header-max-length': [0], | ||
'type-enum': [ | ||
2, | ||
'always', | ||
['feat', 'feature', 'fix', 'refactor', 'docs', 'build', 'test', 'ci', 'chore'] | ||
] | ||
} | ||
}; | ||
|
||
export default commitLintConfig; |
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,15 @@ | ||
root=true | ||
|
||
[*] | ||
tab_width=2 | ||
indent_size=2 | ||
charset=utf-8 | ||
end_of_line=unset | ||
indent_style=space | ||
max_line_length=100 | ||
insert_final_newline=true | ||
trim_trailing_whitespace=true | ||
|
||
[*.md] | ||
max_line_length=off | ||
trim_trailing_whitespace=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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.DS_Store | ||
.husky | ||
dist | ||
node_modules | ||
pnpm-lock.yaml | ||
!.vscode | ||
!.*.js | ||
!.*.cjs | ||
!.*.mjs | ||
!.*.ts |
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,103 @@ | ||
{ | ||
"$schema": "https://json.schemastore.org/eslintrc.json", | ||
"root": true, | ||
"env": { | ||
"node": true, | ||
"es2024": true | ||
}, | ||
"parser": "@typescript-eslint/parser", | ||
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"], | ||
"plugins": [ | ||
"@typescript-eslint", | ||
"import", | ||
"unused-imports", | ||
"sort-keys-fix", | ||
"sort-destructure-keys", | ||
"prettier" | ||
], | ||
"parserOptions": { | ||
"sourceType": "module", | ||
"ecmaVersion": "latest" | ||
}, | ||
"settings": { | ||
"import/resolver": { | ||
"node": true, | ||
"typescript": true | ||
} | ||
}, | ||
"rules": { | ||
"no-console": "warn", | ||
"prettier/prettier": "error", | ||
"import/no-duplicates": "error", | ||
"sort-keys-fix/sort-keys-fix": "error", | ||
"unused-imports/no-unused-imports": "error", | ||
"@typescript-eslint/consistent-type-imports": "error", | ||
"import/newline-after-import": ["error", { "count": 1 }], | ||
"no-unused-vars": "off", | ||
"unused-imports/no-unused-vars": [ | ||
"error", | ||
{ | ||
"args": "after-used", | ||
"argsIgnorePattern": "^_", | ||
"vars": "all", | ||
"varsIgnorePattern": "^_" | ||
} | ||
], | ||
"padding-line-between-statements": [ | ||
"error", | ||
{ "blankLine": "always", "prev": "directive", "next": "*" }, | ||
{ "blankLine": "any", "prev": "directive", "next": "directive" }, | ||
{ "blankLine": "always", "prev": ["const", "let", "var"], "next": "*" }, | ||
{ "blankLine": "any", "prev": ["const", "let", "var"], "next": ["const", "let", "var"] }, | ||
{ "blankLine": "always", "prev": "*", "next": "return" } | ||
], | ||
"sort-destructure-keys/sort-destructure-keys": [ | ||
"error", | ||
{ | ||
"caseSensitive": true | ||
} | ||
], | ||
"sort-keys": [ | ||
"error", | ||
"asc", | ||
{ | ||
"minKeys": 2, | ||
"natural": false, | ||
"caseSensitive": true | ||
} | ||
], | ||
"sort-imports": [ | ||
"error", | ||
{ | ||
"ignoreCase": false, | ||
"ignoreMemberSort": false, | ||
"allowSeparatedGroups": true, | ||
"ignoreDeclarationSort": true, | ||
"memberSyntaxSortOrder": ["none", "all", "multiple", "single"] | ||
} | ||
], | ||
"import/order": [ | ||
"error", | ||
{ | ||
"groups": [ | ||
"type", | ||
"builtin", | ||
"external", | ||
"internal", | ||
"parent", | ||
"sibling", | ||
"index", | ||
"unknown", | ||
"object" | ||
], | ||
"pathGroupsExcludedImportTypes": ["type"], | ||
"newlines-between": "always", | ||
"warnOnUnassignedImports": true, | ||
"alphabetize": { | ||
"order": "asc", | ||
"caseInsensitive": true | ||
} | ||
} | ||
] | ||
} | ||
} |
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 @@ | ||
* @tianenpang @jrgarciadev |
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,41 @@ | ||
name: Commitlint | ||
|
||
on: | ||
push: | ||
branches: [main, next] | ||
pull_request: | ||
branches: [main, next] | ||
|
||
jobs: | ||
commitlint: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout codebase | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup pnpm | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
run_install: false | ||
- name: Setup node | ||
uses: actions/setup-node@v3 | ||
with: | ||
cache: 'pnpm' | ||
check-latest: true | ||
node-version-file: '.nvmrc' | ||
- name: Install dependencies | ||
run: pnpm install --frozen-lockfile | ||
- name: Run commitlint | ||
id: run_commitlint | ||
uses: wagoid/commitlint-github-action@v5 | ||
with: | ||
configFile: .commitlintrc.js | ||
env: | ||
NODE_PATH: ${{ github.workspace }}/node_modules | ||
- name: Show outputs | ||
if: ${{ always() }} | ||
run: echo ${{ toJSON(steps.run_commitlint.outputs.results) }} |
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,32 @@ | ||
name: Script | ||
|
||
on: | ||
push: | ||
branches: [main, next] | ||
pull_request: | ||
branches: [main, next] | ||
|
||
jobs: | ||
next: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
script: [build] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout codebase | ||
uses: actions/checkout@v3 | ||
- name: Setup pnpm | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
run_install: false | ||
- name: Setup node | ||
uses: actions/setup-node@v3 | ||
with: | ||
cache: 'pnpm' | ||
check-latest: true | ||
node-version-file: '.nvmrc' | ||
- name: Install dependencies | ||
run: pnpm install --frozen-lockfile | ||
- name: Run script | ||
run: pnpm ${{ matrix.script }} |
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 @@ | ||
# output | ||
/dist | ||
|
||
# ide | ||
/.idea | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/.swc | ||
/coverage | ||
__snapshots__ | ||
|
||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
|
||
# logs | ||
*.log | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
.pnpm-debug.log | ||
|
||
# local env files | ||
.env | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
# typescript | ||
*.tsbuildinfo | ||
|
||
# lock | ||
yarn.lock | ||
package-lock.json |
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,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
pnpm commitlint --config .commitlintrc.ts --edit ${1} |
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 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
if [ -t 2 ]; then exec >/dev/tty 2>&1; fi | ||
|
||
pnpm lint-staged -c .lintstagedrc.mjs |
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,33 @@ | ||
'use strict'; | ||
|
||
import { relative } from 'path'; | ||
|
||
import { ESLint } from 'eslint'; | ||
|
||
const removeIgnoredFiles = async (files) => { | ||
const cwd = process.cwd(); | ||
const eslint = new ESLint(); | ||
const relativePaths = files.map((file) => relative(cwd, file)); | ||
const isIgnored = await Promise.all(relativePaths.map((file) => eslint.isPathIgnored(file))); | ||
const filteredFiles = files.filter((_, i) => !isIgnored[i]); | ||
|
||
return filteredFiles.join(' '); | ||
}; | ||
|
||
/** | ||
* Lint Staged Config | ||
*/ | ||
const lintStaged = { | ||
'**/*.{cjs,mjs,js,ts}': async (files) => { | ||
const filesToLint = await removeIgnoredFiles(files); | ||
|
||
return [`eslint -c .eslintrc --max-warnings=0 --fix ${filesToLint}`]; | ||
}, | ||
'**/*.{json,md}': async (files) => { | ||
const filesToLint = await removeIgnoredFiles(files); | ||
|
||
return [`prettier --config .prettierrc --ignore-path --write ${filesToLint}`]; | ||
} | ||
}; | ||
|
||
export default lintStaged; |
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 @@ | ||
lockfile=true | ||
save-exact=true | ||
engine-strict=true | ||
auto-install-peers=true | ||
enable-pre-post-scripts=true | ||
strict-peer-dependencies=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 |
---|---|---|
@@ -0,0 +1 @@ | ||
v18.17.1 |
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 @@ | ||
.DS_Store | ||
.husky | ||
dist | ||
node_modules | ||
pnpm-lock.yaml | ||
!.vscode | ||
!.*.js | ||
!.*.cjs | ||
!.*.mjs | ||
!.*.ts |
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,18 @@ | ||
{ | ||
"$schema": "https://json.schemastore.org/prettierrc.json", | ||
"tabWidth": 2, | ||
"printWidth": 100, | ||
"semi": true, | ||
"useTabs": false, | ||
"singleQuote": true, | ||
"editorconfig": true, | ||
"bracketSpacing": true, | ||
"jsxSingleQuote": false, | ||
"bracketSameLine": false, | ||
"pluginSearchDirs": false, | ||
"endOfLine": "auto", | ||
"arrowParens": "always", | ||
"trailingComma": "none", | ||
"plugins": [], | ||
"overrides": [] | ||
} |
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,9 @@ | ||
{ | ||
"npm.packageManager": "pnpm", | ||
"typescript.tsdk": "node_modules/typescript/lib", | ||
"typescript.enablePromptUseWorkspaceTsdk": true, | ||
"editor.formatOnSave": false, | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": true | ||
} | ||
} |
Oops, something went wrong.