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 app/assets/javascripts
- eslint --ext .es6 app/assets/javascripts - eslint --ext .es6 app/assets/javascripts
- eslint --ext .es6 test/javascripts - eslint --ext .es6 test/javascripts
- eslint --ext .es6 plugins/**/assets/javascripts
- eslint test/javascripts - eslint test/javascripts
before_script: before_script:

View file

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

View file

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

View file

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

View file

@ -147,7 +147,6 @@ export default Ember.Controller.extend({
}).then(results => { }).then(results => {
const poll = results.poll; const poll = results.poll;
const votes = results.vote; const votes = results.vote;
const currentUser = this.currentUser;
this.setProperties({ vote: votes, showResults: true }); this.setProperties({ vote: votes, showResults: true });
this.set("model", Em.Object.create(poll)); 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({ export default Em.View.extend({
templateName: "poll", templateName: "poll",
classNames: ["poll"], classNames: ["poll"],