Skip to content

Commit

Permalink
Release/v2.10.0 (#86)
Browse files Browse the repository at this point in the history
* 更新代码

* 更新

* 'demo'

* d

* 'd'

* 'update'

* 'd'

* '11'

* '11'

* 'data'

* 'd'

* 11

* 11
22
33
44

* 111
222
333
444
555
666

* 1

* 1

* 1

* '11'

* '1'

* 'd'

* Co-authored-by: biaov <[email protected]>
Co-authored-by: biaov2017 <[email protected]>
Co-authored-by: biaov2018 <[email protected]>

* Co-authored-by: biaov <[email protected]>
Co-authored-by: biaov2017 <[email protected]>
Co-authored-by: biaov2018 <[email protected]>

* Co-authored-by: biaov <[email protected]>
Co-authored-by: biaov2017 <[email protected]>
Co-authored-by: biaov2018 <[email protected]>

* Co-authored-by: biaov <[email protected]>
Co-authored-by: biaov2017 <[email protected]>
Co-authored-by: biaov2018 <[email protected]>

* '.'

Co-authored-by: biaov <[email protected]>
Co-authored-by: biaov2017 <[email protected]>
Co-authored-by: biaov2018 <[email protected]>

* 完成

Co-authored-by: biaov <[email protected]>
Co-authored-by: biaov2017 <[email protected]>
Co-authored-by: biaov2018 <[email protected]>

* 更新依赖版本

Co-authored-by: biaov <[email protected]>
Co-authored-by: biaov2017 <[email protected]>
Co-authored-by: biaov2018 <[email protected]>

* update

Co-authored-by: biaov <[email protected]>
Co-authored-by: biaov2017 <[email protected]>
Co-authored-by: biaov2018 <[email protected]>

* v2.10.0

- 🔥 新增 [showLoading](https://mineh5ui.biaov.cn/v2/showLoading) 加载提示组件
- 🔥 新增 `git push` 时执行单元测试
- 🔥 新增依赖 @eslint/js, globals, typescript-eslint
- ⚙️ 更新依赖版本
- ⚙️ 更新文档
- ⚙️ 更新 vite-plugin-dts 由 `3.x` 升级到 `4.x`
- ⚙️ 更新 @types/node 由 `20.x` 升级到 `22.x`
- ⚙️ 更新 eslint 由 `8.x` 升级到 `9.x`
- ⚙️ 更新 `eslint9.x` 的新配置
- ⚙️ 移除依赖 @typescript-eslint/parser, @typescript-eslint/eslint-plugin, eslint-config-airbnb-base, eslint-config-prettier, eslint-plugin-import
- 🐞 修复代码格式错误
- 🐞 修复 button 文档链接问题

Co-authored-by: biaov <[email protected]>
Co-authored-by: biaov2017 <[email protected]>
Co-authored-by: biaov2018 <[email protected]>

* - 修复类型缺陷

Co-authored-by: biaov <[email protected]>
Co-authored-by: biaov2017 <[email protected]>
Co-authored-by: biaov2018 <[email protected]>

---------

Co-authored-by: biaov <[email protected]>
Co-authored-by: biaov2017 <[email protected]>
  • Loading branch information
3 people committed Aug 12, 2024
1 parent 610e59c commit f5d841b
Show file tree
Hide file tree
Showing 112 changed files with 2,028 additions and 1,953 deletions.
9 changes: 0 additions & 9 deletions .editorconfig

This file was deleted.

4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/node_modules
.DS_Store
/dist
format.*
/format.*
pnpm-lock.yaml
.log
.bak
4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

1 change: 1 addition & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# npm run test:unit
4 changes: 4 additions & 0 deletions .husky/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
echo "" >>"$1"
echo "Co-authored-by: biaov <[email protected]>" >>"$1"
echo "Co-authored-by: biaov2017 <[email protected]>" >>"$1"
echo "Co-authored-by: biaov2018 <[email protected]>" >>"$1"
1 change: 0 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
/* 推荐扩展 */
"recommendations": ["Vue.volar", "esbenp.prettier-vscode"]
}
11 changes: 9 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
{
/* 保存时自动格式化 */
"editor.formatOnSave": true,
"editor.unicodeHighlight.nonBasicASCII": false
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.unicodeHighlight.nonBasicASCII": false,
"prettier.tabWidth": 2,
"prettier.useTabs": false,
"prettier.semi": false,
"prettier.singleQuote": true,
"prettier.arrowParens": "avoid",
"prettier.trailingComma": "none",
"files.eol": "\n"
}
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ npm i mine-h5-ui

### 使用

```js
```ts
import { createApp } from 'vue'
import App from './App.vue'
import mineh5ui from 'mine-h5-ui'
Expand Down Expand Up @@ -159,22 +159,19 @@ npm run build

#### devDependencies

- `@eslint/js`: Eslint js 解析器
- `@types/mockjs`: `mockjs` 的类型
- `@types/node`: `node` 的类型
- `@types/postcss-pxtorem`: `postcss-pxtorem` 的类型
- `@types/qrcode`: `qrcode` 的类型
- `@typescript-eslint/eslint-plugin`: 检测和修复 TS 代码
- `@typescript-eslint/parser`: 解析 TS 代码并生成抽象语法树(AST),以供 Eslint 进行代码检查
- `@vitejs/plugin-vue`: Vite 解析 Vue 文件
- `@vue/compiler-sfc`: 编译 Vue 单文件组件
- `@vue/test-utils`: 单元测试和集成测试
- `autoprefixer`: 添加浏览器厂商前缀
- `eslint`: 代码检查工具
- `eslint-config-airbnb-base`: airbnb-base 代码编写规范
- `eslint-config-prettier`: 将 Prettier 规则集成到 ESlint 检查中
- `eslint-plugin-import`: 检测和修复 JS 中的模块导入导出问题
- `eslint-plugin-prettier`: 检测不符合 Prettier 格式的代码
- `eslint-plugin-vue`: 检测和修复 Vue 代码
- `globals`: 全局类型,Node 和 Browser
- `autoprefixer`: 使用 Gulp 添加浏览器厂商前缀
- `husky`: Git 操作时自动触发脚本
- `jsdom`: 模拟浏览器环境
Expand All @@ -186,6 +183,7 @@ npm run build
- `tslib`: TS 库
- `tailwindcss`: 根据 html class 生成样式
- `typescript`: 编程语言
- `typescript-eslint`: TS 的 Eslint 解析器
- `unplugin-vue-markdown`: 解析 Markdown 文件的 Vite 插件
- `vite`: 项目构建工具
- `vite-plugin-dts`: 生成 `.d.ts` 文件的 Vite 插件
Expand Down
2 changes: 1 addition & 1 deletion auto-cli.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
reject: ['eslint']
reject: []
9 changes: 3 additions & 6 deletions config/plugins.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { Options } from '@vitejs/plugin-vue'
import { getHighlighter, bundledLanguages } from 'shiki'
import { getSingletonHighlighter, bundledLanguages } from 'shiki'
import MarkdownItContainer from 'markdown-it-container'
import type MarkdownIt from 'markdown-it'
import { VitePWAOptions } from 'vite-plugin-pwa'
import { resolve } from 'path'
import type { Options as EslintOptions } from 'vite-plugin-eslint'
import { eslintBaseConfig } from '../eslint.config'
import type { MarkdownViteOptions, TokenItem } from './types'

const { dirname } = import.meta
Expand Down Expand Up @@ -37,7 +35,7 @@ export const markdownViteConfig: MarkdownViteOptions = {
*/
// const themes = ['github-light', 'github-dark', 'dark-plus', 'light-plus']
const theme = 'github-light'
const highlighter = await getHighlighter({ themes: [theme], langs: Object.keys(bundledLanguages) })
const highlighter = await getSingletonHighlighter({ themes: [theme], langs: Object.keys(bundledLanguages) })
md.set({
highlight: (code: string, lang: string) => highlighter.codeToHtml(code, { lang, theme })
})
Expand Down Expand Up @@ -92,8 +90,7 @@ export const vitePwaConfig: Partial<VitePWAOptions> = {
/**
* Eslint 配置
*/
export const eslintConfig: EslintOptions = {
baseConfig: eslintBaseConfig,
export const eslintConfig = {
lintOnStart: true,
exclude: ['node_modules', 'dist', 'fonts']
}
Expand Down
3 changes: 2 additions & 1 deletion config/types.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import type MarkdownIt from 'markdown-it'
import type { Options } from 'markdown-it'

/**
* markdown vite 配置
*/
export interface MarkdownViteOptions {
markdownItOptions?: MarkdownIt.Options
markdownItOptions?: Options
markdownItSetup?: (mdIt: MarkdownIt) => void | Promise<void>
wrapperClasses?: string | string[] | undefined | null | ((id: string, code: string) => string | string[] | undefined | null)
}
Expand Down
178 changes: 178 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
import globals from 'globals'
import pluginJs from '@eslint/js'
import tseslint from 'typescript-eslint'
import pluginVue from 'eslint-plugin-vue'
import prettier from 'eslint-plugin-prettier'

const developmentOff = process.env.NODE_ENV === 'development' ? 'off' : 'error'

export default [
{
files: ['**/*.{js,ts,vue}'],
plugins: {
prettier
}
},
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
NodeListOf: 'readonly',
EventListenerOrEventListenerObject: 'readonly',
NodeJS: 'readonly',
defineSlots: 'readonly',
defineOptions: 'readonly',
describe: 'readonly',
test: 'readonly',
expect: 'readonly'
},
parserOptions: {
parser: tseslint.parser
}
}
},
pluginJs.configs.recommended,
...tseslint.configs.recommended,
...pluginVue.configs['flat/essential'],
{
rules: {
/**
* 禁止未使用的变量
*/
'no-unused-vars': developmentOff,

/**
* 禁止 console
*/
'no-console': developmentOff,

/**
* 禁止未使用的表达式
*/
'no-unused-expressions': [
'error',
{
/**
* 允许短路逻辑
*/
allowShortCircuit: true,

/**
* 允许三目运算
*/
allowTernary: true
}
],

/**
* 如果只有一个值,要用 default 导出
*/
'import/prefer-default-export': 'off',

/**
* import 识别路径,因为 alias 设置
*/
'import/no-unresolved': 'off',

/**
* 扩展简写
*/
'import/extensions': 'off',

/**
* 函数参数修改
*/
'no-param-reassign': 'off',

/**
* 一元操作符
*/
'no-plusplus': 'off',

/**
* 禁用嵌套的三元表达式
*/
'no-nested-ternary': 'off',

/**
* 禁用按位运算符
*/
'no-bitwise': 'off',

/**
* 禁止连续赋值
*/
'no-multi-assign': 'off',

/**
* 禁止默认导出
*/
'no-restricted-exports': 'off',

/**
* 禁止多个单词名称
*/
'vue/multi-word-component-names': 'off',

/**
* 禁止包 dependencies
*/
'import/no-extraneous-dependencies': 'off',

/**
* 属性名
*/
'vue/valid-attribute-name': 'off',
/**
* 短路逻辑运算
*/
'@typescript-eslint/no-unused-expressions': 'off',
/**
* 允许不是具体的函数内容
*/
'@typescript-eslint/no-unsafe-function-type': 'off',
/**
* 不允许命名空间
*/
'@typescript-eslint/no-namespace': 'off',
/**
* 不能为空对象
*/
'@typescript-eslint/no-empty-object-type': 'off',
/**
* 强类型
*/
'@typescript-eslint/no-non-null-asserted-optional-chain': 'off'
}
},
{
files: ['**/components/*.vue'],
rules: {
'vue/multi-word-component-names': 'error'
}
},
{
files: ['./mobile/**/*.ts', './tests/**/*.ts'],
rules: {
'no-console': 'off'
}
},
{
files: ['**/types.ts', '**/*.d.ts'],
rules: {
'no-unused-vars': 'off',
'no-shadow': 'off',
'@typescript-eslint/no-explicit-any': 'off'
}
},
{
files: ['mobile/**/*.ts', 'mobile/**/*.vue', 'tests/**/*.ts'],
rules: {
'no-console': 'off'
}
},
{
ignores: ['node_modules', 'dist', '**/fonts/**']
}
]
Loading

0 comments on commit f5d841b

Please sign in to comment.