Skip to content

Commit

Permalink
feat: access f2elint
Browse files Browse the repository at this point in the history
  • Loading branch information
Jairwin-L committed Apr 11, 2024
1 parent 1a936d7 commit 5276617
Show file tree
Hide file tree
Showing 73 changed files with 4,511 additions and 1,982 deletions.
26 changes: 15 additions & 11 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
{
"presets": [
[
"@babel/preset-env", {
"targets": {
"chrome": "67"
},
"useBuiltIns": "usage"
}
],
["@babel/preset-react", {
"runtime": "automatic"
}]
"@babel/preset-env",
{
"targets": {
"chrome": "67"
},
"useBuiltIns": "usage"
}
],
[
"@babel/preset-react",
{
"runtime": "automatic"
}
]
],
"plugins": [
"@babel/transform-runtime",
Expand All @@ -22,7 +26,7 @@
],
["@babel/plugin-proposal-class-properties", { "loose": true }],
// ["import", {"libraryName": "antd", "style": true}],
["dynamic-import-webpack"], // 异步代码(import)
["dynamic-import-webpack"], // 异步代码(import)
"react-hot-loader/babel"
]
}
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
max_line_length = 100
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
quote_type = single
10 changes: 10 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
build
coverage
dist
es
lib
node_modules
package-lock.json
pnpm-lock.yaml
yarn.lock
*.min.js
32 changes: 0 additions & 32 deletions .eslintrc.js

This file was deleted.

22 changes: 11 additions & 11 deletions .github/workflows/webpack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: react-cli

on:
push:
branches: [ "main" ]
branches: ['main']
pull_request:
branches: [ "main" ]
branches: ['main']

jobs:
build:
Expand All @@ -15,14 +15,14 @@ jobs:
node-version: [14.x, 16.x, 18.x]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Build
run: |
pnpm install
npx webpack
- name: Build
run: |
pnpm install
npx webpack
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

PATH=$(pwd)/.node/bin:$(pwd)/node_modules/.bin:$PATH commitlint --edit ${1}
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

PATH=$(pwd)/.node/bin:$(pwd)/node_modules/.bin:$PATH lint-staged
11 changes: 11 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
build
coverage
dist
es
lib
node_modules
package-lock.json
pnpm-lock.yaml
yarn.lock
*.min.js
*.min.css
10 changes: 10 additions & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
build
coverage
dist
es
lib
node_modules
package-lock.json
pnpm-lock.yaml
yarn.lock
*.min.css
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"editorconfig.editorconfig",
"esbenp.prettier-vscode",
"stylelint.vscode-stylelint"
]
}
45 changes: 45 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"],
"stylelint.validate": ["css", "scss", "less"],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.fixAll.stylelint": "explicit",
"source.organizeImports": "explicit"
},
"editor.rulers": [100],
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"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"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ yarn add less-loader style-loader css-loader -D
## TODO

- [ ] 完成 webpack 升级[进行中]
- [ ] 增加代码规范检测
- [ ] 增加代码规范检测[进行中]
- [ ] 代码重构

## FAQ
Expand Down
2 changes: 1 addition & 1 deletion build-hash.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"hash":"2e7702bc0756b27f37b8"}
{ "hash": "2e7702bc0756b27f37b8" }
Loading

0 comments on commit 5276617

Please sign in to comment.