Skip to content

Commit

Permalink
chore(lint): cover more files
Browse files Browse the repository at this point in the history
  • Loading branch information
eiinu committed Nov 8, 2023
1 parent a0a2a6b commit e57ad7d
Show file tree
Hide file tree
Showing 79 changed files with 462 additions and 783 deletions.
4 changes: 0 additions & 4 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
"root": true,
"extends": ["@nutui/eslint-config"],
"ignorePatterns": [
"packages/nutui-playground/dist/**",
"packages/nutui-taro-demo/**/*",
"packages/nutui-touch-emulator/dist/**",
"packages/nutui-vscode-extension/dist/**",
"src/sites/**"
]
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"test": "vitest",
"test:ui": "vitest --ui --coverage",
"test:c": "vitest --coverage",
"lint": "eslint --ext .vue,.ts,.tsx,.js,.jsx src/",
"lint": "eslint ./src ./packages/**/src --ext .vue,.ts,.tsx,.js,.jsx",
"lint:fix": "pnpm lint --fix",
"copydocs": "node ./scripts/copymd.cjs",
"attrs:taro": "node ./scripts/createAttributes.cjs taro",
Expand Down Expand Up @@ -116,7 +116,7 @@
},
"lint-staged": {
"*.{ts,tsx,js,jsx,vue,scss,md}": "prettier --write",
"src/**/*.{ts,tsx,js,jsx,vue}": "eslint --fix"
"*.{ts,tsx,js,jsx,vue}": "eslint --fix"
},
"repository": {
"type": "git",
Expand Down
8 changes: 4 additions & 4 deletions packages/nutui-playground/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ watchEffect(() => {
<template>
<Header :store="store" />
<Repl
@keydown.ctrl.s.prevent
@keydown.meta.s.prevent
:editor="CodeMirror"
:store="store"
:showImportMap="false"
:showTsConfig="false"
:show-import-map="false"
:show-ts-config="false"
@keydown.ctrl.s.prevent
@keydown.meta.s.prevent
/>
</template>

Expand Down
2 changes: 1 addition & 1 deletion packages/nutui-playground/src/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ function toggleDark() {
<div class="links">
<VersionSelect
:model-value="nutuiVersion"
@update:model-value="setNutUIVersion"
pkg="@nutui/nutui"
label="NutUI Version"
@update:model-value="setNutUIVersion"
>
</VersionSelect>
<button title="Toggle dark mode" class="toggle-dark" @click="toggleDark">
Expand Down
2 changes: 1 addition & 1 deletion packages/nutui-taro-demo/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": ["taro/vue3"]
"extends": ["taro/vue3", "@nutui/eslint-config"]
}
2 changes: 1 addition & 1 deletion packages/nutui-taro-demo/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const config = {
prebundle: { enable: false }
},
mini: {
webpackChain(chain, webpack) {
webpackChain(chain) {
chain.merge({
module: {
rule: [
Expand Down
1 change: 0 additions & 1 deletion packages/nutui-taro-demo/config/prod.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const path = require('path');
module.exports = {
env: {
NODE_ENV: '"production"'
Expand Down
3 changes: 0 additions & 3 deletions packages/nutui-taro-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,11 @@
"@tarojs/cli": "3.6.14",
"@tarojs/webpack5-runner": "3.6.14",
"@types/webpack-env": "^1.18.2",
"@typescript-eslint/eslint-plugin": "^6.7.5",
"@typescript-eslint/parser": "^6.7.5",
"babel-loader": "^9.1.3",
"babel-preset-taro": "3.6.14",
"css-loader": "^6.8.1",
"eslint": "^8.51.0",
"eslint-config-taro": "3.6.14",
"eslint-plugin-vue": "^9.17.0",
"style-loader": "^3.3.3",
"stylelint": "^15.10.3",
"typescript": "^5.2.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/nutui-taro-demo/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import NutUI from '@/packages/nutui.taro.vue';
// import '@nutui/nutui-taro/dist/style.css';
import '@nutui/touch-emulator'; // 适配 taro h5 示例桌面端预览
const App = createApp({
onShow(options) {}
onShow() {}
// 入口组件不需要实现 render 方法,即使实现了也会被 taro所覆盖
}).use(NutUI);

Expand Down
2 changes: 1 addition & 1 deletion packages/nutui-taro-demo/src/basic/pages/cell/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
</nut-cell-group>

<h2>展示图标</h2>
<nut-cell title="姓名" icon="my" desc="张三" isLink>
<nut-cell title="姓名" icon="my" desc="张三" is-link>
<template #icon>
<My />
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<nut-checkbox v-model="formData2.checkbox">复选框</nut-checkbox>
</nut-form-item>
<nut-form-item label="单选按钮">
<nut-radio-group direction="horizontal" v-model="formData2.radio">
<nut-radio-group v-model="formData2.radio" direction="horizontal">
<nut-radio label="1">选项1</nut-radio>
<nut-radio disabled label="2">选项2</nut-radio>
<nut-radio label="3">选项3</nut-radio>
Expand All @@ -31,20 +31,20 @@
<nut-input-number v-model="formData2.number" />
</nut-form-item>
<nut-form-item label="滑块">
<nut-range hidden-tag v-model="formData2.range"></nut-range>
<nut-range v-model="formData2.range" hidden-tag></nut-range>
</nut-form-item>
<nut-form-item label="文件上传">
<nut-uploader url="http://服务地址" v-model:file-list="formData2.defaultFileList" maximum="3" multiple>
<nut-uploader v-model:file-list="formData2.defaultFileList" url="http://服务地址" maximum="3" multiple>
</nut-uploader>
</nut-form-item>
<nut-form-item label="地址">
<input
class="nut-input-text"
v-model="formData2.address"
@click="addressModule.methods.show"
class="nut-input-text"
readonly
placeholder="请选择地址"
type="text"
@click="addressModule.methods.show"
/>
<!-- nut-address -->
<nut-address
Expand All @@ -53,8 +53,8 @@
:city="addressModule.state.city"
:country="addressModule.state.country"
:town="addressModule.state.town"
@close="addressModule.methods.onClose"
custom-address-title="请选择所在地区"
@close="addressModule.methods.onClose"
></nut-address>
</nut-form-item>
</nut-form>
Expand All @@ -63,7 +63,7 @@
<nut-config-provider :theme-vars="themeVars">
<nut-form>
<nut-form-item label="滑块">
<nut-range hidden-tag v-model="formData2.range"></nut-range>
<nut-range v-model="formData2.range" hidden-tag></nut-range>
</nut-form-item>
</nut-form>
</nut-config-provider>
Expand Down
4 changes: 2 additions & 2 deletions packages/nutui-taro-demo/src/basic/pages/icon/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<IconFont name="dongdong" size="26"></IconFont>
</nut-cell>

<nut-cell-group v-for="item in (IconFontConfig as any).data" :title="item.name" :key="item">
<nut-cell-group v-for="item in (IconFontConfig as any).data" :key="item" :title="item.name">
<nut-cell>
<ul>
<li v-for="it in item.icons" :key="it">
Expand All @@ -43,7 +43,7 @@
</nut-cell>
</nut-cell-group>

<nut-cell-group v-for="item in (IconFontConfig as any).style" :title="item.name" :key="item">
<nut-cell-group v-for="item in (IconFontConfig as any).style" :key="item" :title="item.name">
<nut-cell>
<ul class="icon-ul">
<li v-for="it in item.icons" :key="it" class="icon-li">
Expand Down
22 changes: 11 additions & 11 deletions packages/nutui-taro-demo/src/basic/pages/popup/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,43 @@
<Header v-if="env === 'WEB'" />
<h2>基础用法</h2>
<nut-cell title="展示弹出层" is-link @click="showBasic = true"></nut-cell>
<nut-popup pop-class="popclass" :style="{ padding: '30px 50px' }" v-model:visible="showBasic" :z-index="100">
<nut-popup v-model:visible="showBasic" pop-class="popclass" :style="{ padding: '30px 50px' }" :z-index="100">
正文
</nut-popup>

<h2>弹出位置</h2>
<nut-cell title="顶部弹出" is-link @click="showTop = true"></nut-cell>
<nut-popup position="top" :style="{ height: '10%' }" v-model:visible="showTop"></nut-popup>
<nut-popup v-model:visible="showTop" position="top" :style="{ height: '10%' }"></nut-popup>

<nut-cell title="底部弹出" is-link @click="showBottom = true"></nut-cell>
<nut-popup position="bottom" :style="{ height: '20%' }" v-model:visible="showBottom"></nut-popup>
<nut-popup v-model:visible="showBottom" position="bottom" :style="{ height: '20%' }"></nut-popup>

<nut-cell title="左侧弹出" is-link @click="showLeft = true"></nut-cell>
<nut-popup position="left" :style="{ width: '20%', height: '100%' }" v-model:visible="showLeft"></nut-popup>
<nut-popup v-model:visible="showLeft" position="left" :style="{ width: '20%', height: '100%' }"></nut-popup>

<nut-cell title="右侧弹出" is-link @click="showRight = true"></nut-cell>
<nut-popup position="right" :style="{ width: '20%', height: '100%' }" v-model:visible="showRight"></nut-popup>
<nut-popup v-model:visible="showRight" position="right" :style="{ width: '20%', height: '100%' }"></nut-popup>

<h2>关闭图标</h2>
<nut-cell title="关闭图标" is-link @click="showIcon = true"></nut-cell>
<nut-popup position="bottom" closeable :style="{ height: '20%' }" v-model:visible="showIcon"></nut-popup>
<nut-popup v-model:visible="showIcon" position="bottom" closeable :style="{ height: '20%' }"></nut-popup>

<nut-cell title="图标位置" is-link @click="showIconPosition = true"></nut-cell>
<nut-popup
v-model:visible="showIconPosition"
position="bottom"
closeable
close-icon-position="top-left"
:style="{ height: '20%' }"
v-model:visible="showIconPosition"
></nut-popup>

<nut-cell title="自定义图标" is-link @click="showCloseIcon = true"></nut-cell>
<nut-popup
v-model:visible="showCloseIcon"
position="bottom"
closeable
close-icon-position="top-left"
:style="{ height: '20%' }"
v-model:visible="showCloseIcon"
>
<template #close-icon>
<Heart></Heart>
Expand All @@ -48,14 +48,14 @@

<h2>圆角弹框</h2>
<nut-cell title="圆角弹框" is-link @click="showRound = true"></nut-cell>
<nut-popup position="bottom" closeable round :style="{ height: '30%' }" v-model:visible="showRound"></nut-popup>
<nut-popup v-model:visible="showRound" position="bottom" closeable round :style="{ height: '30%' }"></nut-popup>

<h2>多层堆叠</h2>
<nut-cell title="多层堆叠" is-link @click="showPop1 = true"></nut-cell>
<nut-popup :style="{ padding: '30px 50px' }" v-model:visible="showPop1">
<nut-popup v-model:visible="showPop1" :style="{ padding: '30px 50px' }">
<div @click="showPop2 = true">点击它</div>
</nut-popup>
<nut-popup :style="{ padding: '30px 50px' }" v-model:visible="showPop2">正文</nut-popup>
<nut-popup v-model:visible="showPop2" :style="{ padding: '30px 50px' }">正文</nut-popup>
</div>
</template>

Expand Down
10 changes: 5 additions & 5 deletions packages/nutui-taro-demo/src/business/pages/address/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
:city="address.city"
:country="address.country"
:town="address.town"
:columns-placeholder="placeholder"
@change="(cal) => onChange(cal, 'select')"
@close="close6"
:columns-placeholder="placeholder"
></nut-address>

<h2>选择自定义地址2</h2>
Expand All @@ -41,9 +41,9 @@
:country="address.country"
:town="address.town"
height="270px"
:columns-placeholder="placeholder"
@change="(cal) => onChange(cal, 'normal2')"
@close="close5"
:columns-placeholder="placeholder"
></nut-address>

<h2>选择已有地址</h2>
Expand All @@ -53,9 +53,9 @@
v-model:visible="showPopup.exist"
type="exist"
:exist-address="existAddress"
:is-show-custom-address="false"
@change="(cal) => onChange(cal, 'exist')"
@close="close2"
:is-show-custom-address="false"
@selected="selected"
></nut-address>

Expand All @@ -66,12 +66,12 @@
v-model:visible="showPopup.customImg"
type="exist"
:exist-address="existAddress"
@close="close3"
:is-show-custom-address="false"
@selected="selected"
:default-icon="icon.defaultIcon"
:selected-icon="icon.selectedIcon"
:close-btn-icon="icon.closeBtnIcon"
@close="close3"
@selected="selected"
>
<template #unselected-icon>
<Heart1 style="margin-right: 8px"></Heart1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,38 @@
<h2>基础用法</h2>
<nut-address-list
:data="data"
:show-bottom-button="false"
:data-Options="dataOptions"
@del-icon="delClick"
@edit-icon="editClick"
@click-item="clickItem"
:showBottomButton="false"
:data-Options="dataOptions"
>
</nut-address-list>
<h2>长按功能</h2>
<nut-address-list
:data="data"
longPress
:showBottomButton="false"
long-press
:show-bottom-button="false"
:data-Options="dataOptions"
@del-icon="delClick"
@edit-icon="editClick"
@click-item="clickItem"
@long-copy="copyClick"
@long-set="setClick"
@long-del="delClickLong"
:data-Options="dataOptions"
>
</nut-address-list>
<h2>滑动功能</h2>
<nut-address-list
:data="data"
swipeEdition
showBottomButton
swipe-edition
show-bottom-button
:data-Options="dataOptions"
@del-icon="delClick"
@edit-icon="editClick"
@click-item="clickItem"
@swipe-del="delClickSwipe"
@add="addAddress"
:data-Options="dataOptions"
>
</nut-address-list>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<nut-barrage ref="danmu" :danmu="list"></nut-barrage>
</nut-cell>
<div class="test">
<nut-button @click="addDanmu" class="add nut-button--primary">随机添加</nut-button>
<nut-button class="add nut-button--primary" @click="addDanmu">随机添加</nut-button>
</div>
</div>
</template>
Expand Down
Loading

0 comments on commit e57ad7d

Please sign in to comment.