Skip to content

Commit

Permalink
chore: add styleLint and deploy action
Browse files Browse the repository at this point in the history
  • Loading branch information
LHRUN committed Jan 21, 2023
1 parent 837b68b commit 68de970
Show file tree
Hide file tree
Showing 8 changed files with 3,905 additions and 2,070 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: deploy gh-page
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
name: build and deploy gh-page
env:
COMMIT_SECRET: ${{secrets.commit_secret}}
USER_NAME: songlh
USER_EMAIL: [email protected]
PUBLISH_DIR: ./dist
GITHUB_REPOSITORY: paint-board
runs-on: ubuntu-latest
steps:
- name: checkout repository main branch
uses: actions/checkout@main
- name: with node.js
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: npm install
run: |
npm install -g pnpm
pnpm install
- name: npm run build
run: |
pnpm build
- name: commit files
run: |
cd $PUBLISH_DIR
git init
git config --local user.name $USER_NAME
git config --local user.email $USER_EMAIL
git status
git remote add origin https://[email protected]/$GITHUB_REPOSITORY.git
git checkout -b gh-pages
git add --all
git commit -m "deploy to github pages"
git push origin gh-pages -f
echo deploy gh-pages complete
2 changes: 2 additions & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
dist
32 changes: 32 additions & 0 deletions .stylelintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
module.exports = {
// 注册 stylelint 的 prettier 插件
plugins: ['stylelint-prettier'],
// 继承一系列规则集合
extends: [
// standard 规则集合
'stylelint-config-standard',
// 样式属性顺序规则
'stylelint-config-recess-order',
// 接入 Prettier 规则
'stylelint-config-prettier',
'stylelint-prettier/recommended'
],
overrides: [
{
files: ['**/*.tsx'],
customSyntax: '@stylelint/postcss-css-in-js',
},
],
// 配置 rules
rules: {
// 开启 Prettier 自动格式化功能
'prettier/prettier': true,
"at-rule-no-unknown": [
true,
{
"ignoreAtRules": ["tailwind"]
}
],
"selector-class-pattern": "^[a-z][a-zA-Z0-9]+$"
}
};
53 changes: 31 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,45 +8,54 @@
"build": "tsc && vite build",
"preview": "vite preview",
"deploy": "node deploy.cjs",
"lint": "eslint --ext .js,.jsx,.ts,.tsx --fix --quiet ./"
"lint": "pnpm lint:script && pnpm lint:style",
"lint:script": "eslint --ext .js,.jsx,.ts,.tsx --fix --quiet ./",
"lint:style": "stylelint --fix \"src/**/*.css\""
},
"dependencies": {
"classnames": "^2.3.2",
"daisyui": "^2.27.0",
"daisyui": "^2.46.1",
"lodash": "^4.17.21",
"react": "^18.2.0",
"react-dnd": "^16.0.1",
"react-dnd-html5-backend": "^16.0.1",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@commitlint/cli": "^17.1.2",
"@commitlint/config-conventional": "^17.1.0",
"@commitlint/cli": "^17.4.1",
"@commitlint/config-conventional": "^17.4.0",
"@stylelint/postcss-css-in-js": "^0.38.0",
"@types/lodash": "^4.14.191",
"@types/node": "^18.7.16",
"@types/react": "^18.0.17",
"@types/react-dom": "^18.0.6",
"@typescript-eslint/eslint-plugin": "^5.36.2",
"@typescript-eslint/parser": "^5.36.2",
"@vitejs/plugin-react": "^2.1.0",
"autoprefixer": "^10.4.8",
"eslint": "^8.23.0",
"eslint-config-prettier": "^8.5.0",
"@types/node": "^18.11.18",
"@types/react": "^18.0.26",
"@types/react-dom": "^18.0.10",
"@typescript-eslint/eslint-plugin": "^5.48.1",
"@typescript-eslint/parser": "^5.48.1",
"@vitejs/plugin-react": "^2.2.0",
"autoprefixer": "^10.4.13",
"eslint": "^8.31.0",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.31.8",
"eslint-plugin-react": "^7.31.11",
"gh-pages": "^4.0.0",
"husky": "^8.0.1",
"lint-staged": "^13.0.3",
"postcss": "^8.4.16",
"prettier": "^2.7.1",
"tailwindcss": "^3.1.8",
"typescript": "^4.6.4",
"vite": "^3.1.0",
"husky": "^8.0.3",
"lint-staged": "^13.1.0",
"postcss": "^8.4.21",
"postcss-syntax": "^0.36.2",
"prettier": "^2.8.2",
"stylelint": "^14.16.1",
"stylelint-config-prettier": "^9.0.4",
"stylelint-config-recess-order": "^3.1.0",
"stylelint-config-standard": "^29.0.0",
"stylelint-prettier": "^2.0.0",
"tailwindcss": "^3.2.4",
"typescript": "^4.9.4",
"vite": "^3.2.5",
"vite-plugin-eslint": "^1.8.1"
},
"lint-staged": {
"*.{js,jsx,tsx,ts}": [
"npm run lint"
"pnpm lint"
]
}
}
Loading

0 comments on commit 68de970

Please sign in to comment.