Skip to content

Commit

Permalink
chore(lint): remove some eslint rules (#2408)
Browse files Browse the repository at this point in the history
  • Loading branch information
eiinu authored Jul 11, 2023
1 parent 026c7f2 commit 91e3a74
Show file tree
Hide file tree
Showing 155 changed files with 343 additions and 464 deletions.
14 changes: 6 additions & 8 deletions packages/nutui-eslint-config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,20 @@ module.exports = {
TaroGeneral: true
},
rules: {
// @typescript-eslint
'@typescript-eslint/no-explicit-any': 'off',
// '@typescript-eslint/no-unused-vars': 'error',
// enable type: Function Object
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/no-var-requires': 'off',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'error',
// eslint-plugin-vue
'vue/no-v-html': 'off',
'vue/first-attribute-linebreak': 'off',
'vue/multi-word-component-names': 'off',
'vue/no-v-text-v-html-on-component': 'off',
// will be fixed
// will be removed someday
'vue/attributes-order': 'off',
'vue/attribute-hyphenation': 'off',
'vue/v-on-event-hyphenation': 'off',
'vue/v-slot-style': 'off',
'no-unused-vars': 'off',
'vue/valid-v-for': 'off',
'no-empty': 'off'
'vue/v-on-event-hyphenation': 'off'
}
};
1 change: 1 addition & 0 deletions packages/nutui-eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"dependencies": {
"@typescript-eslint/eslint-plugin": "^5.60.1",
"@typescript-eslint/parser": "^5.60.1",
"vue-eslint-parser": "^9.3.1",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-vue": "^9.15.1"
},
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/packages/__VUE/address/demo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ export default defineComponent({
text.two = val.data.addressStr;
}
};
const selected = (prevExistAdd: AddressList, nowExistAdd: RegionData, arr: AddressList[]) => {
const selected = (prevExistAdd: AddressList, nowExistAdd: RegionData) => {
console.log(prevExistAdd);
console.log(nowExistAdd);
};
Expand Down
4 changes: 2 additions & 2 deletions src/packages/__VUE/audio/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
inactive-color="#cccccc"
active-color="#fa2c19"
>
<template v-slot:button>
<template #button>
<div class="nut-audio__button--custom"></div>
</template>
</nut-range>
Expand Down Expand Up @@ -64,7 +64,7 @@ import { toRefs, ref, onMounted, reactive, watch, provide, Component } from 'vue
import { createComponent } from '@/packages/utils/create';
import { Service } from '@nutui/icons-vue';
import Range from '../range/index.vue';
const { componentName, create } = createComponent('audio');
const { create } = createComponent('audio');
export default create({
props: {
Expand Down
6 changes: 3 additions & 3 deletions src/packages/__VUE/audiooperate/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
</div>
</template>
<script lang="ts">
import { toRefs, ref, useSlots, onMounted, reactive, inject } from 'vue';
import { toRefs, ref, useSlots, reactive, inject } from 'vue';
import { createComponent } from '@/packages/utils/create';
import Button from '../button/index.vue';
const { componentName, create, translate } = createComponent('audio-operate');
const { create, translate } = createComponent('audio-operate');
export default create({
props: {
Expand All @@ -41,7 +41,7 @@ export default create({
},
emits: ['click'],
setup(props, { emit }) {
setup(props) {
const audio: any = inject('audioParent');
const parent: {
children: [];
Expand Down
8 changes: 2 additions & 6 deletions src/packages/__VUE/avatargroup/index.taro.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</view>
</template>
<script lang="ts">
import { toRefs, onMounted, computed, provide, ref } from 'vue';
import { onMounted, computed, provide, ref } from 'vue';
import { createComponent } from '@/packages/utils/create';
const { componentName, create } = createComponent('avatar-group');
export default create({
Expand Down Expand Up @@ -42,13 +42,9 @@ export default create({
default: 'left'
}
},
setup(props, { emit, slots }) {
const { size } = toRefs(props);
setup(props) {
const avatarGroupRef = ref(null);
const index = ref(0);
// const sizeValue = ['large', 'normal', 'small'];
const classes = computed(() => {
const prefixCls = componentName;
Expand Down
8 changes: 2 additions & 6 deletions src/packages/__VUE/avatargroup/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</view>
</template>
<script lang="ts">
import { toRefs, onMounted, computed, provide, ref } from 'vue';
import { onMounted, computed, provide, ref } from 'vue';
import { createComponent } from '@/packages/utils/create';
const { componentName, create } = createComponent('avatar-group');
export default create({
Expand Down Expand Up @@ -42,13 +42,9 @@ export default create({
default: 'left'
}
},
setup(props, { emit, slots }) {
const { size } = toRefs(props);
setup(props) {
const avatarGroupRef = ref(null);
const index = ref(0);
// const sizeValue = ['large', 'normal', 'small'];
const classes = computed(() => {
const prefixCls = componentName;
Expand Down
4 changes: 2 additions & 2 deletions src/packages/__VUE/barrage/index.taro.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</view>
</template>
<script lang="ts">
import { computed, onMounted, ref, reactive, watch, onUnmounted, onDeactivated, useSlots } from 'vue';
import { computed, onMounted, ref, reactive, watch, useSlots } from 'vue';
import { createComponent } from '@/packages/utils/create';
import Taro from '@tarojs/taro';
const { componentName, create } = createComponent('barrage');
Expand Down Expand Up @@ -49,7 +49,7 @@ export default create({
},
emits: ['click'],
setup(props, { slots }) {
setup(props) {
const classTime = new Date().getTime();
const slotDefault = !!useSlots().default;
Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/button/demo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ const initTranslate = () =>
export default defineComponent({
components: { StarFill, Star },
props: {},
setup(props) {
setup() {
initTranslate();
let isLoading = ref(false);
const changeLoading = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/button/index.taro.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default create({
}
},
emits: ['click'],
setup(props, { emit, slots }) {
setup(props, { emit }) {
const { type, size, shape, disabled, loading, color, plain, block } = toRefs(props);
const handleClick = (event: MouseEvent) => {
Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/button/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default create({
}
},
emits: ['click'],
setup(props, { emit, slots }) {
setup(props, { emit }) {
const { type, size, shape, disabled, loading, color, plain, block } = toRefs(props);
const handleClick = (event: MouseEvent) => {
Expand Down
6 changes: 3 additions & 3 deletions src/packages/__VUE/calendar/demo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
@close="closeSwitch('isVisible5')"
@choose="setChooseValue5"
>
<template v-slot:btn>
<template #btn>
<div class="wrapper">
<div class="d_div">
<span class="d_btn" @click="goDate">{{ translate('goDate') }}</span>
Expand All @@ -151,7 +151,7 @@
</div>
</div>
</template>
<template v-slot:day="date">
<template #day="date">
<span>{{ date.date.day }}</span>
</template>
</nut-calendar>
Expand All @@ -177,7 +177,7 @@
:end-text="translate('leave')"
:title="translate('please')"
>
<template v-slot:day="date">
<template #day="date">
<span>{{ renderDate(date) }}</span>
</template>
<template #bottom-info="date">
Expand Down
2 changes: 0 additions & 2 deletions src/packages/__VUE/calendaritem/index.taro.vue
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,6 @@ export default create({
} else if (props.type == 'multiple' && Array.isArray(state.currDate)) {
if (state.currDate.length > 0) {
let defaultArr: string[] = [];
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let obj: any = {};
state.currDate.forEach((item: string) => {
if (
Expand Down Expand Up @@ -742,7 +741,6 @@ export default create({
return Utils.isEqual(date, Utils.date2Str(new Date()));
};
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const mothsViewScroll = (e: any) => {
if (state.monthsData.length <= 1) {
return;
Expand Down
3 changes: 1 addition & 2 deletions src/packages/__VUE/card/index.taro.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
</template>

<script lang="ts">
import { computed, reactive } from 'vue';
import { createComponent } from '@/packages/utils/create';
import Price from '../price/index.taro.vue';
import Tag from '../tag/index.taro.vue';
Expand Down Expand Up @@ -83,7 +82,7 @@ export default create({
}
},
setup(props, { emit, slots }) {
setup(props, { slots }) {
const isHaveSlot = (slot: string) => {
return slots[slot];
};
Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/card/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default create({
}
},
setup(props, { emit, slots }) {
setup(props, { slots }) {
const isHaveSlot = (slot: string) => {
return slots[slot];
};
Expand Down
1 change: 0 additions & 1 deletion src/packages/__VUE/cascader/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export type CascaderOption = {
leaf?: boolean;
level?: number;
loading?: boolean;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[key: PropertyKey]: any;
};

Expand Down
4 changes: 2 additions & 2 deletions src/packages/__VUE/category/index.taro.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<script lang="ts">
import { PropType, ref } from 'vue';
import { createComponent } from '@/packages/utils/create';
const { componentName, create } = createComponent('category');
const { create } = createComponent('category');
export type CategoryType = {
catName?: string;
Expand All @@ -41,7 +41,7 @@ export default create({
}
},
setup(props, { emit, slots }) {
setup(props, { emit }) {
const checkIndex = ref(0);
const categoryLeft = ref(false); //是否显示slot
Expand Down
4 changes: 2 additions & 2 deletions src/packages/__VUE/category/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<script lang="ts">
import { PropType, ref } from 'vue';
import { createComponent } from '@/packages/utils/create';
const { componentName, create } = createComponent('category');
const { create } = createComponent('category');
export type CategoryType = {
catName?: string;
Expand All @@ -40,7 +40,7 @@ export default create({
}
},
setup(props, { emit, slots }) {
setup(props, { emit }) {
const checkIndex = ref(0);
const categoryLeft = ref(false); //是否显示slot
Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/categorypane/index.taro.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<script lang="ts">
import { PropType } from 'vue';
import { createComponent } from '@/packages/utils/create';
const { componentName, create } = createComponent('category-pane');
const { create } = createComponent('category-pane');

export type ChildType = {
catName?: string;
Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/categorypane/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<script lang="ts">
import { PropType } from 'vue';
import { createComponent } from '@/packages/utils/create';
const { componentName, create } = createComponent('category-pane');
const { create } = createComponent('category-pane');

export type ChildType = {
catName?: string;
Expand Down
10 changes: 5 additions & 5 deletions src/packages/__VUE/cell/demo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<h2>{{ translate('title8') }}</h2>

<nut-cell :desc="translate('desc')">
<template v-slot:title>
<template #title>
<span>Title <b style="color: red">1</b></span>
</template>
</nut-cell>
Expand All @@ -37,15 +37,15 @@

<nut-cell-group :title="translate('customRight')">
<nut-cell title="Switch">
<template v-slot:link>
<template #link>
<nut-switch v-model="switchChecked" />
</template>
</nut-cell>
</nut-cell-group>

<nut-cell-group :title="translate('customLeftIcon')">
<nut-cell :title="translate('image')">
<template v-slot:icon>
<template #icon>
<img
style="width: 20px; height: 20px"
src="https://img11.360buyimg.com/imagetools/jfs/t1/137646/13/7132/1648/5f4c748bE43da8ddd/a3f06d51dcae7b60.png"
Expand All @@ -56,7 +56,7 @@

<h2>{{ translate('displayIcon') }}</h2>
<nut-cell :title="translate('name')" :desc="translate('desc')" isLink>
<template v-slot:icon>
<template #icon>
<My />
</template>
</nut-cell>
Expand Down Expand Up @@ -129,7 +129,7 @@ export default defineComponent({
components: { My },
setup() {
initTranslate();
const testClick = (event: Event) => {
const testClick = () => {
console.log('Click Test');
};
const switchChecked = ref(true);
Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/checkbox/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export const component = (componentName: string, components: Record<string, Comp
);
};

const handleClick = (e: MouseEvent | TouchEvent) => {
const handleClick = () => {
if (pDisabled.value) return;
if (checked.value && state.partialSelect) {
state.partialSelect = false;
Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/checkbox/demo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export default defineComponent({
components: {
Checklist
},
setup(props, context) {
setup() {
initTranslate();
const group = ref(null) as Ref;
const group2 = ref(null) as Ref;
Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/circleprogress/index.taro.vue
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export default create({
watch(
() => props.progress,
(value, oldvalue) => {
(value) => {
currentRate.value = Math.min(Math.max(+value, 0), 100);
emit('update:progress', format(parseFloat(Number(value).toFixed(1))));
}
Expand Down
Loading

0 comments on commit 91e3a74

Please sign in to comment.