-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add tcb-shop miniprogram example
- Loading branch information
joeyzzeng
committed
Sep 23, 2024
1 parent
823da35
commit 3864983
Showing
412 changed files
with
26,213 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,157 @@ | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
commonjs: true, | ||
es6: true, | ||
}, | ||
parserOptions: { | ||
ecmaVersion: 2020, | ||
// ECMAScript modules 模式 | ||
sourceType: 'module', | ||
}, | ||
extends: ['plugin:prettier/recommended', 'prettier'], | ||
globals: { | ||
wx: true, | ||
App: true, | ||
Page: true, | ||
Component: true, | ||
getApp: true, | ||
getCurrentPages: true, | ||
Behavior: true, | ||
global: true, | ||
__wxConfig: true, | ||
}, | ||
ignorePatterns: ['*.wxs'], | ||
rules: { | ||
'prettier/prettier': 'warn', | ||
'no-undef': 'off', | ||
camelcase: 'off', | ||
'class-name-casing': 'off', | ||
'no-console': ['warn', { allow: ['warn', 'error'] }], | ||
'no-debugger': 'error', | ||
'no-unused-expressions': ['error', { allowShortCircuit: true, allowTernary: true }], | ||
'no-empty-interface': 'off', | ||
'no-use-before-define': ['error', { functions: false }], | ||
'no-useless-constructor': 'error', | ||
'prefer-const': 'error', | ||
'prefer-destructuring': [ | ||
'error', | ||
{ | ||
AssignmentExpression: { | ||
array: false, | ||
object: false, | ||
}, | ||
VariableDeclarator: { | ||
array: false, | ||
object: true, | ||
}, | ||
}, | ||
{ | ||
enforceForRenamedProperties: false, | ||
}, | ||
], | ||
'no-const-assign': 'error', | ||
'no-new-object': 'error', | ||
'no-prototype-builtins': 'error', | ||
'no-array-constructor': 'error', | ||
'array-callback-return': 'warn', | ||
'prefer-template': 'error', | ||
'no-useless-escape': 'error', | ||
'wrap-iife': ['error', 'outside'], | ||
'space-before-function-paren': [ | ||
'warn', | ||
{ | ||
anonymous: 'always', | ||
named: 'never', | ||
asyncArrow: 'always', | ||
}, | ||
], | ||
'no-param-reassign': [ | ||
'warn', | ||
{ | ||
props: true, | ||
ignorePropertyModificationsFor: [ | ||
'acc', // for reduce accumulators | ||
'accumulator', // for reduce accumulators | ||
'e', // for e.returnvalue | ||
'ctx', // for Koa routing | ||
'req', // for Express requests | ||
'request', // for Express requests | ||
'res', // for Express responses | ||
'response', // for Express responses | ||
'$scope', // for Angular 1 scopes | ||
'staticContext', // for ReactRouter context | ||
'state', // for Vuex | ||
], | ||
}, | ||
], | ||
'no-confusing-arrow': 'warn', | ||
'no-dupe-class-members': 'error', | ||
'no-iterator': 'warn', | ||
'dot-notation': 'warn', | ||
'one-var': ['warn', 'never'], | ||
'no-multi-assign': 'error', | ||
'no-unused-vars': [ | ||
'error', | ||
{ | ||
args: 'after-used', | ||
ignoreRestSiblings: true, | ||
argsIgnorePattern: '^_.+', | ||
varsIgnorePattern: '^_.+', | ||
}, | ||
], | ||
eqeqeq: ['warn', 'always'], | ||
'no-case-declarations': 'error', | ||
'no-nested-ternary': 'warn', | ||
'no-unneeded-ternary': 'warn', | ||
'no-mixed-operators': [ | ||
'error', | ||
{ | ||
groups: [ | ||
['%', '**'], | ||
['%', '+'], | ||
['%', '-'], | ||
['%', '*'], | ||
['%', '/'], | ||
['&', '|', '<<', '>>', '>>>'], | ||
['==', '!=', '===', '!=='], | ||
['&&', '||'], | ||
], | ||
allowSamePrecedence: false, | ||
}, | ||
], | ||
'no-else-return': [ | ||
'warn', | ||
{ | ||
allowElseIf: false, | ||
}, | ||
], | ||
'no-new-wrappers': 'warn', | ||
indent: [ | ||
'warn', | ||
2, | ||
{ | ||
SwitchCase: 1, | ||
VariableDeclarator: 1, | ||
outerIIFEBody: 1, | ||
FunctionDeclaration: { | ||
parameters: 1, | ||
body: 1, | ||
}, | ||
FunctionExpression: { | ||
parameters: 1, | ||
body: 1, | ||
}, | ||
CallExpression: { | ||
arguments: 1, | ||
}, | ||
ArrayExpression: 1, | ||
ObjectExpression: 1, | ||
ImportDeclaration: 1, | ||
flatTernaryExpressions: false, | ||
ignoreComments: false, | ||
}, | ||
], | ||
'linebreak-style': ['warn', 'unix'], | ||
}, | ||
}; |
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,16 @@ | ||
node_modules/ | ||
yarn-error.log | ||
miniprogram/ | ||
miniprogram_npm/ | ||
miniprogram_dist/ | ||
.DS_Store | ||
$node_modules/ | ||
.history/ | ||
**/dist | ||
components/**/*.lock | ||
components/**/package-lock.json | ||
package-lock.json | ||
yarn.lock | ||
project.private.config.json | ||
.eslintcache | ||
cloudfunctions/ |
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 @@ | ||
# 去除注释可以使用代理进行安装 | ||
# proxy=http://127.0.0.1:1080 | ||
# https_proxy=http://127.0.0.1:1080 | ||
|
||
# 去除注释可以使用淘宝源 | ||
# registry=https://registry.npm.taobao.org | ||
|
||
# 去除注释可以使用腾讯源 | ||
#registry=http://mirrors.tencent.com/npm/ |
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,3 @@ | ||
miniprogram_npm | ||
package.json | ||
project.config.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,49 @@ | ||
# 一行最多 100 字符 | ||
printWidth: 120 | ||
# 使用 2 个空格缩进 | ||
tabWidth: 2 | ||
# 不使用缩进符,而使用空格 | ||
useTabs: false | ||
# 行尾需要分号 | ||
semi: true | ||
# 使用单引号 | ||
singleQuote: true | ||
# 对象的 key 仅在必要时用引号 | ||
quoteProps: as-needed | ||
# jsx 不使用单引号,而使用双引号 | ||
jsxSingleQuote: false | ||
# 末尾需要逗号 | ||
trailingComma: all | ||
# 大括号内的首尾需要空格 | ||
bracketSpacing: true | ||
# jsx 标签的反尖括号需要换行 | ||
jsxBracketSameLine: false | ||
# 箭头函数,只有一个参数的时候,不需要括号 | ||
arrowParens: always | ||
# 每个文件格式化的范围是文件的全部内容 | ||
rangeStart: 0 | ||
# 不需要写文件开头的 @prettier | ||
requirePragma: false | ||
# 不需要自动在文件开头插入 @prettier | ||
insertPragma: false | ||
# 使用默认的折行标准 | ||
proseWrap: preserve | ||
# 根据显示样式决定 html 要不要折行 | ||
htmlWhitespaceSensitivity: css | ||
# 换行符使用 lf | ||
endOfLine: lf | ||
# 后缀文件名特有规则 | ||
overrides: | ||
- files: '*.{wxss,less}' | ||
options: | ||
parser: less | ||
- files: '*.json,.*rc' | ||
options: | ||
parser: json | ||
- files: '*.{wxml,html}' | ||
options: | ||
parser: html | ||
htmlWhitespaceSensitivity: strict | ||
- files: '*.wxs' | ||
options: | ||
parser: babel |
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 @@ | ||
MIT License | ||
|
||
Copyright (c) 2021-present TDesign | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
Oops, something went wrong.