chore: 使用了 f2elint 规范项目开发
使用阿里巴巴前端规约 规范开发 参考文档: https://alibaba.github.io/f2e-spec/zh/ https://github.com/alibaba/f2e-spec https://git.onemue.cn/flexlark/f2e-spec
This commit is contained in:
11
.editorconfig
Normal file
11
.editorconfig
Normal file
@@ -0,0 +1,11 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
max_line_length = 100
|
||||
quote_type = single
|
||||
trim_trailing_whitespace = true
|
||||
3
.husky/commit-msg
Executable file
3
.husky/commit-msg
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
PATH=$(pwd)/.node/bin:$(pwd)/node_modules/.bin:$PATH commitlint --edit ${1}
|
||||
3
.husky/pre-commit
Normal file → Executable file
3
.husky/pre-commit
Normal file → Executable file
@@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
PATH=$(pwd)/.node/bin:$(pwd)/node_modules/.bin:$PATH lint-staged
|
||||
|
||||
11
.prettierignore
Normal file
11
.prettierignore
Normal file
@@ -0,0 +1,11 @@
|
||||
build
|
||||
coverage
|
||||
dist
|
||||
es
|
||||
lib
|
||||
node_modules
|
||||
package-lock.json
|
||||
pnpm-lock.yaml
|
||||
yarn.lock
|
||||
*.min.js
|
||||
*.min.css
|
||||
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"trailingComma": "es5",
|
||||
"semi": false,
|
||||
"singleQuote": true,
|
||||
"arrowParens": "always",
|
||||
"printWidth": 100
|
||||
}
|
||||
8
.vscode/extensions.json
vendored
Normal file
8
.vscode/extensions.json
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"dbaeumer.vscode-eslint",
|
||||
"editorconfig.editorconfig",
|
||||
"esbenp.prettier-vscode",
|
||||
"stylelint.vscode-stylelint"
|
||||
]
|
||||
}
|
||||
38
.vscode/settings.json
vendored
38
.vscode/settings.json
vendored
@@ -25,16 +25,32 @@
|
||||
"mode": "auto"
|
||||
}
|
||||
],
|
||||
"eslint.validate": [
|
||||
"javascript",
|
||||
"javascriptreact",
|
||||
"typescript",
|
||||
"typescriptreact"
|
||||
],
|
||||
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"],
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll.eslint": "always"
|
||||
"source.fixAll.eslint": "explicit",
|
||||
"source.fixAll.stylelint": "explicit",
|
||||
"source.organizeImports": "explicit"
|
||||
},
|
||||
"cSpell.words": [
|
||||
"Tamagui"
|
||||
],
|
||||
}
|
||||
"cSpell.words": ["Tamagui"],
|
||||
"stylelint.validate": ["css", "scss", "less"],
|
||||
"editor.rulers": [100],
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"[vue]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"[css]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"[less]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"[scss]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"[html]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"[jsonc]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
}
|
||||
}
|
||||
|
||||
4
eslint.config.mjs
Normal file
4
eslint.config.mjs
Normal file
@@ -0,0 +1,4 @@
|
||||
import { react } from 'eslint-config-ali';
|
||||
import prettier from 'eslint-plugin-prettier/recommended';
|
||||
|
||||
export default [...react, prettier];
|
||||
69
package.json
69
package.json
@@ -1,36 +1,61 @@
|
||||
{
|
||||
"name": "app-template",
|
||||
"private": true,
|
||||
"homepage": "https://git.onemue.cn/flexlark/app-template#readme",
|
||||
"bugs": {
|
||||
"url": "https://git.onemue.cn/flexlark/app-template/issues"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://git.onemue.cn/flexlark/app-template.git"
|
||||
},
|
||||
"author": {
|
||||
"name": "eeymoo",
|
||||
"email": "eeymoo@xmail.fun"
|
||||
},
|
||||
"workspaces": [
|
||||
"./apps/*",
|
||||
"./packages/*"
|
||||
],
|
||||
"scripts": {
|
||||
"android": "cd apps/expo && yarn android",
|
||||
"build": "yarn workspaces foreach --all --exclude next-app run build",
|
||||
"check-tamagui": "tamagui check",
|
||||
"ci:eslint": "eslint -f json src -o ./.ci/eslint.json",
|
||||
"postinstall": "yarn check-tamagui && yarn build",
|
||||
"ios": "cd apps/expo && yarn ios",
|
||||
"lint": "eslint .",
|
||||
"lint:fix": "prettier --write . && eslint --fix .",
|
||||
"native": "cd apps/expo && yarn start",
|
||||
"native:prebuild": "cd apps/expo && yarn prebuild",
|
||||
"ios": "cd apps/expo && yarn ios",
|
||||
"android": "cd apps/expo && yarn android",
|
||||
"watch": "ultra -r --no-pretty --concurrency 400 watch",
|
||||
"prepare": "husky",
|
||||
"test": "vitest run",
|
||||
"test:watch": "vitest",
|
||||
"upgrade:tamagui": "yarn up '*tamagui*'@latest '@tamagui/*'@latest",
|
||||
"upgrade:tamagui:canary": "yarn up '*tamagui*'@canary '@tamagui/*'@canary",
|
||||
"vercel:install": "yarn set version 3.5 && yarn install",
|
||||
"watch": "ultra -r --no-pretty --concurrency 400 watch",
|
||||
"web": "yarn build && cd apps/next && yarn next",
|
||||
"web:extract": "DISABLE_EXTRACTION=false yarn workspace next-app dev",
|
||||
"web:prod": "yarn workspace next-app build",
|
||||
"web:prod:serve": "yarn workspace next-app serve",
|
||||
"postinstall": "yarn check-tamagui && yarn build",
|
||||
"build": "yarn workspaces foreach --all --exclude next-app run build",
|
||||
"upgrade:tamagui": "yarn up '*tamagui*'@latest '@tamagui/*'@latest",
|
||||
"upgrade:tamagui:canary": "yarn up '*tamagui*'@canary '@tamagui/*'@canary",
|
||||
"check-tamagui": "tamagui check",
|
||||
"test": "vitest run",
|
||||
"test:watch": "vitest",
|
||||
"prepare": "husky"
|
||||
"web:prod:serve": "yarn workspace next-app serve"
|
||||
},
|
||||
"commitlint": {
|
||||
"extends": [
|
||||
"@commitlint/config-conventional"
|
||||
]
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.{cjs,cts,js,jsx,mjs,mts,ts,tsx,vue}": "eslint --fix",
|
||||
"*.{cjs,css,cts,html,js,json,jsx,less,md,mjs,mts,scss,ts,tsx,vue,yaml,yml}": "prettier --write"
|
||||
},
|
||||
"prettier": "prettier-config-ali",
|
||||
"resolutions": {
|
||||
"react": "19.0.0",
|
||||
"react-dom": "19.0.0",
|
||||
"react-refresh": "^0.14.0",
|
||||
"react-native-svg": "15.11.2",
|
||||
"react-native-web": "~0.19.12"
|
||||
"react-native-web": "~0.19.12",
|
||||
"react-refresh": "^0.14.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.24.6",
|
||||
@@ -45,12 +70,22 @@
|
||||
"ultra-runner": "^3.10.5",
|
||||
"vitest": "^2.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "^1.9.3",
|
||||
"@commitlint/cli": "^19.8.1",
|
||||
"@commitlint/config-conventional": "^19.8.1",
|
||||
"eslint": "^9.34.0",
|
||||
"eslint-config-ali": "^16.5.0",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-plugin-prettier": "^5.5.4",
|
||||
"husky": "^9.1.7",
|
||||
"lint-staged": "^16.1.5",
|
||||
"prettier": "^3.6.2",
|
||||
"prettier-config-ali": "^1.5.0"
|
||||
},
|
||||
"packageManager": "yarn@4.5.0",
|
||||
"engines": {
|
||||
"node": "22",
|
||||
"npm": "10.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "^1.9.3"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user