-
Notifications
You must be signed in to change notification settings - Fork 3
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
Showing
61 changed files
with
67,927 additions
and
4,045 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,7 +1,67 @@ | ||
{ | ||
"extends": ["taro/react"], | ||
"plugins": ["@typescript-eslint", "simple-import-sort", "unused-imports"], | ||
"extends": [ | ||
"taro/react", | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:@typescript-eslint/recommended-requiring-type-checking", | ||
"plugin:react-hooks/recommended", | ||
"prettier", | ||
"plugin:prettier/recommended" | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": "latest", | ||
"sourceType": "module", | ||
"project": true, | ||
"tsconfigRootDir": "__dirname" | ||
}, | ||
"rules": { | ||
"react/jsx-uses-react": "off", | ||
"react/react-in-jsx-scope": "off" | ||
"react/react-in-jsx-scope": "off", | ||
"no-unused-vars": "off", | ||
"no-console": "warn", | ||
"@typescript-eslint/explicit-module-boundary-types": "off", | ||
"react/no-unescaped-entities": "off", | ||
"react/display-name": "off", | ||
"react/jsx-curly-brace-presence": ["warn", { "props": "never", "children": "never" }], | ||
"@typescript-eslint/no-unused-vars": "off", | ||
"unused-imports/no-unused-imports": "warn", | ||
"unused-imports/no-unused-vars": [ | ||
"warn", | ||
{ | ||
"vars": "all", | ||
"varsIgnorePattern": "^_", | ||
"args": "after-used", | ||
"argsIgnorePattern": "^_" | ||
} | ||
], | ||
"simple-import-sort/exports": "warn", | ||
"simple-import-sort/imports": [ | ||
"warn", | ||
{ | ||
"groups": [ | ||
["^@?\\w", "^\\u0000"], | ||
["^.+\\.s?css$"], | ||
["^@/libs", "^@/hooks"], | ||
["^@/data"], | ||
["^@/components", "^@/container"], | ||
["^@/store"], | ||
["^@/"], | ||
[ | ||
"^\\./?$", | ||
"^\\.(?!/?$)", | ||
"^\\.\\./?$", | ||
"^\\.\\.(?!/?$)", | ||
"^\\.\\./\\.\\./?$", | ||
"^\\.\\./\\.\\.(?!/?$)", | ||
"^\\.\\./\\.\\./\\.\\./?$", | ||
"^\\.\\./\\.\\./\\.\\.(?!/?$)" | ||
], | ||
["^@/types"], | ||
["^"] | ||
] | ||
} | ||
] | ||
} | ||
} |
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,8 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: 'npm' | ||
directory: '/' | ||
schedule: | ||
interval: 'daily' | ||
open-pull-requests-limit: 10 | ||
versioning-strategy: 'auto' |
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,39 @@ | ||
name: Build Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
lint-and-format: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18' | ||
|
||
- name: Install dependencies | ||
run: yarn install | ||
|
||
- name: Run Build | ||
run: yarn build:weapp | ||
|
||
- name: Check for merge conflicts | ||
if: github.event_name == 'pull_request' | ||
run: | | ||
git fetch --no-tags --prune origin +refs/heads/*:refs/remotes/origin/* | ||
git checkout -qf ${{ github.event.pull_request.head.sha }} | ||
git merge-base --is-ancestor origin/main ${{ github.event.pull_request.head.sha }} || git merge --no-commit --no-ff origin/main | ||
if [ $? -ne 0 ]; then | ||
echo "Merge conflicts detected. Please resolve them before merging." | ||
exit 1 | ||
fi |
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,42 @@ | ||
name: Lint and Format Check | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
lint-and-format: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18' | ||
|
||
- name: Install dependencies | ||
run: yarn install | ||
|
||
- name: Run Prettier | ||
run: npx prettier --check . | ||
|
||
- name: Run ESLint | ||
run: npx eslint . | ||
|
||
- name: Check for merge conflicts | ||
if: github.event_name == 'pull_request' | ||
run: | | ||
git fetch --no-tags --prune origin +refs/heads/*:refs/remotes/origin/* | ||
git checkout -qf ${{ github.event.pull_request.head.sha }} | ||
git merge-base --is-ancestor origin/main ${{ github.event.pull_request.head.sha }} || git merge --no-commit --no-ff origin/main | ||
if [ $? -ne 0 ]; then | ||
echo "Merge conflicts detected. Please resolve them before merging." | ||
exit 1 | ||
fi |
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,8 @@ | ||
command_exists () { | ||
command -v "$1" >/dev/null 2>&1 | ||
} | ||
|
||
# Workaround for Windows 10, Git Bash, and Yarn | ||
if command_exists winpty && test -t 1; then | ||
exec < /dev/tty | ||
fi |
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 | ||
export GIT_TERMINAL_PROMPT=0 | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
. "$(dirname -- "$0")/common.sh" | ||
|
||
yarn lint |
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,8 @@ | ||
node_modules | ||
.DS_Store | ||
dist | ||
dist-ssr | ||
*.local | ||
project.config.json | ||
project.private.config.json | ||
auto-imports.d.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 @@ | ||
{ | ||
"plugins": ["prettier-plugin-organize-imports"], | ||
"trailingComma": "es5", | ||
"semi": true, | ||
"singleQuote": true, | ||
"arrowParens": "always", | ||
"printWidth": 90, | ||
"tabWidth": 2, | ||
"endOfLine": "auto", | ||
"overrides": [ | ||
{ | ||
"files": ".eslintrc", | ||
"options": { | ||
"trailingComma": "none" | ||
} | ||
} | ||
] | ||
} |
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,3 @@ | ||
{ | ||
"editor.inlineSuggest.showToolbar": "onHover" | ||
"editor.inlineSuggest.showToolbar": "onHover" | ||
} |
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,12 +1,10 @@ | ||
import TestUtils from '@tarojs/test-utils-react' | ||
import TestUtils from '@tarojs/test-utils-react'; | ||
|
||
describe('Testing', () => { | ||
|
||
test('Test', async () => { | ||
const testUtils = new TestUtils() | ||
await testUtils.createApp() | ||
await testUtils.PageLifecycle.onShow('pages/index/index') | ||
expect(testUtils.html()).toMatchSnapshot() | ||
}) | ||
|
||
}) | ||
const testUtils = new TestUtils(); | ||
await testUtils.createApp(); | ||
await testUtils.PageLifecycle.onShow('pages/index/index'); | ||
expect(testUtils.html()).toMatchSnapshot(); | ||
}); | ||
}); |
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
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,10 +1,10 @@ | ||
import type { UserConfigExport } from "@tarojs/cli"; | ||
import type { UserConfigExport } from '@tarojs/cli'; | ||
|
||
export default { | ||
logger: { | ||
quiet: false, | ||
stats: true | ||
stats: true, | ||
}, | ||
mini: {}, | ||
h5: {} | ||
} satisfies UserConfigExport | ||
h5: {}, | ||
} satisfies UserConfigExport; |
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
Oops, something went wrong.