Skip to content

Commit 3e35120

Browse files
committed
chore: add example
1 parent def91ea commit 3e35120

File tree

122 files changed

+19482
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+19482
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.5.0",
44
"description": "A collection of configuration files containing prettier, eslint, stylelint",
55
"keywords": [
6-
"code style",
6+
"code lint",
77
"eslint",
88
"stylelint",
99
"prettier"

src/stylelint.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ module.exports = {
1515
ignoreAtRules: ['tailwind'],
1616
},
1717
],
18+
'color-function-notation': 'legacy',
19+
'alpha-value-notation': 'number',
1820
'selector-class-pattern':
1921
'^(?:(?:o|c|u|t|s|is|has|_|js|qa)-)?[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*(?:__[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*)?(?:--[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*)?(?:\\[.+\\])?$',
2022
},

ts-example/.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# http://editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
indent_style = space
8+
indent_size = 2
9+
end_of_line = lf
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
13+
[*.md]
14+
insert_final_newline = false
15+
trim_trailing_whitespace = false

ts-example/.eslintrc.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
module.exports = {
2+
root: true,
3+
extends: [require.resolve('../lib/eslint'), 'plugin:tailwind/recommended'],
4+
rules: {
5+
'import/no-unresolved': [2, { ignore: ['^@/'] }],
6+
'react/react-in-jsx-scope': 0,
7+
'@typescript-eslint/no-var-requires': 0,
8+
'@typescript-eslint/no-non-null-assertion': 0,
9+
'@typescript-eslint/no-use-before-define': 2,
10+
'@typescript-eslint/explicit-module-boundary-types': 0,
11+
'@typescript-eslint/consistent-type-imports': [
12+
2,
13+
{
14+
prefer: 'type-imports',
15+
disallowTypeAnnotations: true,
16+
},
17+
],
18+
},
19+
settings: {
20+
react: {
21+
version: 'detect',
22+
},
23+
},
24+
ignorePatterns: [
25+
'public',
26+
'build',
27+
'dist',
28+
'yarn*',
29+
'!.eslintrc.js',
30+
'!.prettierrc.js',
31+
'!.stylelintrc.js',
32+
],
33+
}

ts-example/.gitignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# production
12+
/build
13+
14+
# misc
15+
.DS_Store
16+
.env.local
17+
.env.development.local
18+
.env.test.local
19+
.env.production.local
20+
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*
24+
25+
.vscode
26+
.eslintcache

ts-example/.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
yarn lint-staged

ts-example/.prettierrc.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const prettier = require('../lib/prettier')
2+
3+
module.exports = {
4+
...prettier,
5+
}

ts-example/.stylelintrc.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
extends: [require.resolve('../lib/stylelint')],
3+
ignoreFiles: ['build/**/*.css'],
4+
overrides: [
5+
{
6+
files: ['**/*.scss'],
7+
customSyntax: 'postcss-scss',
8+
},
9+
],
10+
}

ts-example/README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<div align="center">
2+
3+
<img width="150" src="./img/logo.png">
4+
5+
# Portal
6+
7+
**你心中理想的管理系统模板**
8+
9+
<img width="32" src="./img/badge-react.png">
10+
<img width="32" src="./img/badge-ts.png">
11+
12+
</div>
13+
14+
## 界面一览
15+
16+
![](./img/screenshot-1.png)
17+
![](./img/screenshot-2.png)
18+
![](./img/screenshot-3.png)
19+
20+
## 安装依赖
21+
22+
```bash
23+
yarn install # 或使用简写 yarn
24+
```
25+
26+
## 启动项目
27+
28+
```bash
29+
yarn start
30+
```
31+
32+
## 代码格式
33+
34+
在 VS Code 中添加以下配置,将为你在保存文件是自动格式化代码。
35+
36+
```json
37+
{
38+
"editor.formatOnSave": true,
39+
"editor.codeActionsOnSave": {
40+
"source.fixAll.eslint": true,
41+
"source.fixAll.stylelint": true
42+
}
43+
}
44+
```

ts-example/config/dev.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
APP_ROUTER_MODE: '"history"',
3+
}

0 commit comments

Comments
 (0)