Skip to content

Commit 55a8dca

Browse files
committed
style: update lint and format code
1 parent a9f7963 commit 55a8dca

File tree

114 files changed

+1527
-1141
lines changed

Some content is hidden

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

114 files changed

+1527
-1141
lines changed

.eslintrc

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
11
{
2+
"root": true,
23
"env": {
34
"browser": true,
45
"node": true,
56
"jasmine": true,
67
"jest": true,
78
"es6": true
89
},
9-
"parser": "babel-eslint",
10-
"extends": ["plugin:vue-libs/recommended", "prettier"],
10+
"parserOptions": {
11+
"parser": "babel-eslint"
12+
},
13+
"extends": ["plugin:vue/recommended", "prettier"],
1114
"rules": {
1215
"comma-dangle": [2, "always-multiline"],
1316
"no-var": "error",
14-
"no-unused-vars": "warn",
1517
"camelcase": "off",
1618
"no-extra-boolean-cast": "off",
17-
"semi": ["error", "always"]
19+
"semi": ["error", "always"],
20+
"vue/require-prop-types": "off",
21+
"vue/require-default-prop": "off",
22+
"vue/no-reserved-keys": "off"
1823
}
19-
}
24+
}

.jest.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ module.exports = {
2828
: '.*\\.test\\.js$',
2929
moduleNameMapper: {
3030
"^@/(.*)$": "<rootDir>/$1",
31-
"ant-design-vue": "<rootDir>/components/index.js"
31+
"ant-design-vue": "<rootDir>/components/index.js",
32+
"^vue$": "vue/dist/vue.common.js"
3233
},
3334
snapshotSerializers: ["<rootDir>/node_modules/jest-serializer-vue"],
3435
collectCoverage: process.env.COVERAGE === 'true',

components/_util/ContainerRender.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ export default {
5353

5454
if (!this._component) {
5555
this._component = new Vue({
56+
el: el,
57+
parent: self.parent,
5658
data: {
5759
comProps: props,
5860
},
59-
parent: self.parent,
60-
el: el,
6161
mounted() {
6262
this.$nextTick(() => {
6363
if (ready) {

components/_util/FormDecoratorDirective.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export function antDecorator(Vue) {
44

55
export default {
66
// just for tag
7-
install: (Vue, options) => {
7+
install: Vue => {
88
antDecorator(Vue);
99
},
1010
};

components/_util/antDirective.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { antInput } from './antInputDirective';
22
import { antDecorator } from './FormDecoratorDirective';
33

44
export default {
5-
install: (Vue, options) => {
5+
install: Vue => {
66
antInput(Vue);
77
antDecorator(Vue);
88
},

components/_util/antInputDirective.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ if (isIE9) {
4646

4747
export function antInput(Vue) {
4848
return Vue.directive('ant-input', {
49-
inserted(el, binding, vnode, oldVnode) {
49+
inserted(el, binding, vnode) {
5050
if (vnode.tag === 'textarea' || isTextInputType(el.type)) {
5151
if (!binding.modifiers || !binding.modifiers.lazy) {
5252
el.addEventListener('compositionstart', onCompositionStart);
@@ -67,7 +67,7 @@ export function antInput(Vue) {
6767
}
6868

6969
export default {
70-
install: (Vue, options) => {
70+
install: Vue => {
7171
antInput(Vue);
7272
},
7373
};

components/_util/openAnimation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import cssAnimation from './css-animation';
22
import raf from 'raf';
33

4-
function animate(node, show, done, type) {
4+
function animate(node, show, done) {
55
let height;
66
let requestAnimationFrameId;
77
let appearRequestAnimationFrameId;

components/_util/props-util.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ const initDefaultProps = (propTypes, defaultProps) => {
250250
export function mergeProps() {
251251
const args = [].slice.call(arguments, 0);
252252
const props = {};
253-
args.forEach((p = {}, i) => {
253+
args.forEach((p = {}) => {
254254
for (const [k, v] of Object.entries(p)) {
255255
props[k] = props[k] || {};
256256
if (isPlainObject(v)) {

components/_util/vue-types/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ const VuePropTypes = {
111111

112112
let hasCustomValidators = false;
113113

114-
const nativeChecks = arr.reduce((ret, type, i) => {
114+
const nativeChecks = arr.reduce((ret, type) => {
115115
if (isPlainObject(type)) {
116116
if (type._vueTypes_name === 'oneOf') {
117117
return ret.concat(type.type || []);

components/_util/warning.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import warning from 'warning';
22

33
const warned = {};
4-
export default (valid, message, throwError) => {
4+
export default (valid, message) => {
55
if (!valid && !warned[message]) {
66
warning(false, message);
77
warned[message] = true;

0 commit comments

Comments
 (0)