Skip to content

Commit 615b460

Browse files
authored
chore: enhance eslint (#1890)
* perf: enhance eslint * perf: remove props in progress
1 parent e654713 commit 615b460

File tree

74 files changed

+104
-163
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+104
-163
lines changed

.eslintrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
"rules": {
1616
"comma-dangle": [2, "always-multiline"],
1717
"no-var": "error",
18+
"no-console": [2, { "allow": ["warn", "error"] }],
19+
"object-shorthand": 2,
20+
"no-unused-vars": [2, { "ignoreRestSiblings": true, "argsIgnorePattern": "^h$" }],
21+
"no-undef": 2,
1822
"camelcase": "off",
1923
"no-extra-boolean-cast": "off",
2024
"semi": ["error", "always"],
@@ -32,5 +36,8 @@
3236
}
3337
}
3438
]
39+
},
40+
"globals": {
41+
"h": true
3542
}
3643
}

components/_util/ContainerRender.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export default {
5252
}
5353
if (!this._component) {
5454
this._component = new this.$root.constructor({
55-
el: el,
55+
el,
5656
parent: self,
5757
data: {
5858
comProps: props,

components/_util/env.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable no-undef */
12
// Browser environment sniffing
23
export const inBrowser = typeof window !== 'undefined';
34
export const inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;

components/affix/__tests__/index.test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import Affix from '..';
22
import Button from '../../button';
33
import { mount } from '@vue/test-utils';
44
import { spyElementPrototype } from '../../__tests__/util/domHook';
5-
import { asyncExpect } from '@/tests/utils';
65
const events = {};
76

87
const AffixMounter = {
@@ -62,7 +61,7 @@ describe('Affix Render', () => {
6261
});
6362
const movePlaceholder = top => {
6463
classRect.fixed = {
65-
top: top,
64+
top,
6665
bottom: top,
6766
};
6867
events.scroll({

components/affix/index.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import PropTypes from '../_util/vue-types';
22
import classNames from 'classnames';
3-
import shallowequal from 'shallowequal';
43
import omit from 'omit.js';
54
import ResizeObserver from '../vc-resize-observer';
65
import BaseMixin from '../_util/BaseMixin';
@@ -231,7 +230,7 @@ const Affix = {
231230
},
232231

233232
render() {
234-
const { prefixCls, affixStyle, placeholderStyle, status, $slots, $props } = this;
233+
const { prefixCls, affixStyle, placeholderStyle, $slots, $props } = this;
235234
const getPrefixCls = this.configProvider.getPrefixCls;
236235
const className = classNames({
237236
[getPrefixCls('affix', prefixCls)]: affixStyle,

components/breadcrumb/Breadcrumb.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export default {
6161
return originalPaths;
6262
},
6363

64-
genForRoutes({ routes = [], params = {}, separator, itemRender = defaultItemRender }) {
64+
genForRoutes({ routes = [], params = {}, separator, itemRender = this.defaultItemRender }) {
6565
const paths = [];
6666
return routes.map(route => {
6767
const path = this.getPath(route.path, params);

components/button/button-group.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default {
2626
};
2727
},
2828
render() {
29-
const { prefixCls: customizePrefixCls, size, sizeMap, $slots } = this;
29+
const { prefixCls: customizePrefixCls, size, $slots } = this;
3030
const getPrefixCls = this.configProvider.getPrefixCls;
3131
const prefixCls = getPrefixCls('btn-group', customizePrefixCls);
3232

components/button/button.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ export default {
3636
sLoading,
3737
ghost,
3838
block,
39-
sizeMap,
4039
icon,
4140
$slots,
4241
} = this;

components/calendar/Header.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Select from '../select';
22
import { Group, Button } from '../radio';
33
import PropTypes from '../_util/vue-types';
4-
import { initDefaultProps, getComponentFromProp } from '../_util/props-util';
4+
import { initDefaultProps } from '../_util/props-util';
55
import { ConfigConsumerProps } from '../config-provider';
66

77
const { Option } = Select;

components/calendar/index.jsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function zerofixed(v) {
2222
}
2323
export const MomentType = {
2424
type: Object,
25-
validator: function(value) {
25+
validator(value) {
2626
return moment.isMoment(value);
2727
},
2828
};
@@ -207,11 +207,11 @@ const Calendar = {
207207
Select: {},
208208
locale: locale.lang,
209209
type: mode === 'year' ? 'month' : 'date',
210-
prefixCls: prefixCls,
210+
prefixCls,
211211
showHeader: false,
212-
value: value,
213-
monthCellRender: monthCellRender,
214-
dateCellRender: dateCellRender,
212+
value,
213+
monthCellRender,
214+
dateCellRender,
215215
disabledDate,
216216
},
217217
on: {

0 commit comments

Comments
 (0)