Start checking eslint in plugins.

This commit is contained in:
Guo Xiang Tan 2016-06-14 16:11:45 +08:00
parent 8d46727d67
commit ae5a033469
No known key found for this signature in database
GPG Key ID: 19C321C8952B0F72
6 changed files with 5 additions and 15 deletions

View File

@ -45,6 +45,7 @@ before_install:
- eslint app/assets/javascripts
- eslint --ext .es6 app/assets/javascripts
- eslint --ext .es6 test/javascripts
- eslint --ext .es6 plugins/**/assets/javascripts
- eslint test/javascripts
before_script:

View File

@ -1,5 +1,4 @@
import computed from 'ember-addons/ember-computed-decorators';
import User from 'discourse/models/user';
import PollVoters from 'discourse/plugins/poll/components/poll-voters';
export default PollVoters.extend({

View File

@ -1,5 +1,4 @@
import computed from 'ember-addons/ember-computed-decorators';
import User from 'discourse/models/user';
import PollVoters from 'discourse/plugins/poll/components/poll-voters';
export default PollVoters.extend({

View File

@ -70,7 +70,6 @@ export default Ember.Controller.extend({
@computed("isMultiple", "isNumber", "pollOptionsCount", "pollMin", "pollStep")
pollMaxOptions(isMultiple, isNumber, count, pollMin, pollStep) {
if (!isMultiple && !isNumber) return;
var range = [];
const pollMinInt = parseInt(pollMin);
if (isMultiple) {
@ -84,7 +83,6 @@ export default Ember.Controller.extend({
@computed("isNumber", "pollMax")
pollStepOptions(isNumber, pollMax) {
if (!isNumber) return;
return this._comboboxOptions(1, parseInt(pollMax) + 1);
},
@ -99,7 +97,7 @@ export default Ember.Controller.extend({
if (pollMax) pollHeader += ` max=${pollMax}`;
if (isNumber) pollHeader += ` step=${pollStep}`;
if (publicPoll) pollHeader += ' public=true';
pollHeader += ']'
pollHeader += ']';
output += `${pollHeader}\n`;
if (pollOptions.length > 0 && !isNumber) {
@ -112,11 +110,7 @@ export default Ember.Controller.extend({
@computed("pollOptionsCount", "isNumber")
disableInsert(count, isNumber) {
if (isNumber) {
return false;
} else {
return count < 2;
}
return isNumber ? false : (count < 2);
},
@computed("disableInsert")
@ -132,8 +126,8 @@ export default Ember.Controller.extend({
_comboboxOptions(start_index, end_index) {
return _.range(start_index, end_index).map(number => {
return { value: number, name: number }
})
return { value: number, name: number };
});
},
_setupPoll() {

View File

@ -147,7 +147,6 @@ export default Ember.Controller.extend({
}).then(results => {
const poll = results.poll;
const votes = results.vote;
const currentUser = this.currentUser;
this.setProperties({ vote: votes, showResults: true });
this.set("model", Em.Object.create(poll));

View File

@ -1,5 +1,3 @@
import { on } from "ember-addons/ember-computed-decorators";
export default Em.View.extend({
templateName: "poll",
classNames: ["poll"],