Skip to content

Commit

Permalink
eslint,修改格式
Browse files Browse the repository at this point in the history
  • Loading branch information
TeemoWan committed Jan 25, 2016
1 parent e7dcd8a commit b1e3cf4
Show file tree
Hide file tree
Showing 13 changed files with 194 additions and 266 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"linebreak-style": 2,
"lines-around-comment": 0,
"max-depth": 0,
"max-len": [2, 100, 4],
"max-len": [2, 120, 4],
"max-nested-callbacks": 0,
"max-params": 0,
"max-statements": 0,
Expand Down
407 changes: 159 additions & 248 deletions .idea/workspace.xml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/actions/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ export default {
gotoTeamAdd({FlowRouter}) {
FlowRouter.go('/team/add');
}
};
};
1 change: 1 addition & 0 deletions client/components/DocumentAdd/index.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import {$} from 'meteor/jquery';
import classNames from 'classnames';
import '../../lib/semantic-ui/definitions/modules/transition.js';
import '../../lib/semantic-ui/definitions/modules/dropdown.js';
Expand Down
1 change: 1 addition & 0 deletions client/components/Header/index.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import {$} from 'meteor/jquery';
import Search from '../Search/index.jsx';
import '../../lib/semantic-ui/definitions/modules/transition.js';
import '../../lib/semantic-ui/definitions/modules/dropdown.js';
Expand Down
2 changes: 1 addition & 1 deletion client/components/Team/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ const Team = React.createClass({
}
});

export default Team;
export default Team;
6 changes: 4 additions & 2 deletions libs/collections/branch.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import {Random} from 'meteor/random';
import {Mongo} from 'meteor/mongo';
import {SimpleSchema} from 'meteor/aldeed:simple-schema';

const BranchSchema = new SimpleSchema({
_id: {
type: String,
autoValue: function() {
autoValue: function () {
if (this.isInsert) {
return Random.id(24);
}
Expand All @@ -26,7 +28,7 @@ const BranchSchema = new SimpleSchema({
createdAt: {
type: Date,
denyUpdate: true,
autoValue: function() {
autoValue: function () {
if (this.isInsert) {
return new Date();
} else if (this.isUpsert) {
Expand Down
14 changes: 8 additions & 6 deletions libs/collections/commit.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import {Random} from 'meteor/random';
import {Mongo} from 'meteor/mongo';
import {SimpleSchema} from 'meteor/aldeed:simple-schema';

const CommitSchema = new SimpleSchema({
_id: {
type: String,
autoValue: function() {
autoValue: function () {
if (this.isInsert) {
return Random.id(24);
}
Expand All @@ -19,7 +21,7 @@ const CommitSchema = new SimpleSchema({
committedAt: {
type: Date,
denyUpdate: true,
autoValue: function() {
autoValue: function () {
if (this.isInsert) {
return new Date();
} else if (this.isUpsert) {
Expand Down Expand Up @@ -62,19 +64,19 @@ const CommitSchema = new SimpleSchema({
// 提交统计
'statistics.chapterCount': {
type: Number,
autoValue: function() {
autoValue: function () {
return 0;
}
},
'statistics.addCount': {
type: Number,
autoValue: function() {
autoValue: function () {
return 0;
}
},
'statistics.deleteCount': {
type: Number,
autoValue: function() {
autoValue: function () {
return 0;
}
}
Expand All @@ -95,4 +97,4 @@ Commits.allow({
}
});

export default Commits;
export default Commits;
4 changes: 3 additions & 1 deletion libs/collections/document.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import {Random} from 'meteor/random';
import {Mongo} from 'meteor/mongo';
import {SimpleSchema} from 'meteor/aldeed:simple-schema';

const DocumentSchema = new SimpleSchema({
_id: {
type: String,
autoValue: function() {
autoValue: function () {
if (this.isInsert) {
return Random.id(24);
}
Expand Down
6 changes: 4 additions & 2 deletions libs/collections/node.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import {Random} from 'meteor/random';
import {Mongo} from 'meteor/mongo';
import {SimpleSchema} from 'meteor/aldeed:simple-schema';

const NodeSchema = new SimpleSchema({
_id: {
type: String,
autoValue: function() {
autoValue: function () {
if (this.isInsert) {
return Random.id(24);
}
}
},
hash: {
type: String
//max: 40,
// max: 40,
},
type: {
type: String
Expand Down
8 changes: 5 additions & 3 deletions libs/collections/team.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import {Random} from 'meteor/random';
import {Mongo} from 'meteor/mongo';
import {SimpleSchema} from 'meteor/aldeed:simple-schema';

const TeemSchema = new SimpleSchema({
_id: {
type: String,
autoValue: function() {
autoValue: function () {
if (this.isInsert) {
return Random.id(24);
}
Expand All @@ -21,11 +23,11 @@ const TeemSchema = new SimpleSchema({
optional: true
},
admins: {
type: [String],
type: [ String ],
label: '团队管理员'
},
members: {
type: [String],
type: [ String ],
label: '团队成员'
},
documentCount: {
Expand Down
5 changes: 4 additions & 1 deletion libs/collections/user.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import {Meteor} from 'meteor/meteor';
import {SimpleSchema} from 'meteor/aldeed:simple-schema';

const UserSchema = new SimpleSchema({
username: {
type: String,
label: '用户名',
regEx: /^[a-zA-Z0-9_\u4e00-\u9fa5]{2,16}$/
},
emails: {
type: [Object]
type: [ Object ]
},
'emails.$.address': {
type: String,
Expand Down
2 changes: 2 additions & 0 deletions libs/collections/validationMessage.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import {SimpleSchema} from 'meteor/aldeed:simple-schema';

SimpleSchema.messages({
required: '请填写[label]',// '[label] is required',
minString: '[label]不少于[min]个字符', // '[label] must be at least [min] characters',
Expand Down

0 comments on commit b1e3cf4

Please sign in to comment.