diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..72df373 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,20 @@ +# unconventional js +/blueprints/*/files/ +/vendor/ + +# compiled output +/dist/ +/tmp/ + +# dependencies +/bower_components/ +/node_modules/ + +# misc +/coverage/ +!.* + +# ember-try +/.node_modules.ember-try/ +/bower.json.ember-try +/package.json.ember-try diff --git a/.eslintrc.js b/.eslintrc.js index ad16c5d..6ce9b5d 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -25,10 +25,14 @@ module.exports = { // node files { files: [ + '.eslintrc.js', + '.template-lintrc.js', 'ember-cli-build.js', 'testem.js', + 'blueprints/*/index.js', 'config/**/*.js', - 'lib/*/index.js' + 'lib/*/index.js', + 'server/**/*.js' ], parserOptions: { sourceType: 'script', diff --git a/.gitignore b/.gitignore index 5499248..9f5aa52 100644 --- a/.gitignore +++ b/.gitignore @@ -1,24 +1,26 @@ # See https://help.github.com/ignore-files/ for more about ignoring files. # compiled output -/dist -/tmp +/dist/ +/tmp/ # dependencies -/node_modules -/bower_components +/bower_components/ +/node_modules/ # misc +/.env* +/.pnp* /.sass-cache /connect.lock -/coverage/* +/coverage/ /libpeerconnection.log -npm-debug.log* -yarn-error.log -testem.log +/npm-debug.log* +/testem.log +/yarn-error.log .tm_properties # ember-try -.node_modules.ember-try/ -bower.json.ember-try -package.json.ember-try +/.node_modules.ember-try/ +/bower.json.ember-try +/package.json.ember-try diff --git a/.template-lintrc.js b/.template-lintrc.js new file mode 100644 index 0000000..b45e96f --- /dev/null +++ b/.template-lintrc.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = { + extends: 'recommended' +}; diff --git a/.travis.yml b/.travis.yml index 54dcdb2..e63caa7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,5 +22,6 @@ before_install: - npm config set spin false script: + - npm run lint:hbs - npm run lint:js - npm test diff --git a/README.md b/README.md index 690f553..c68767d 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,7 @@ Make use of the many generators for code, try `ember help generate` for more det ### Linting +* `npm run lint:hbs` * `npm run lint:js` * `npm run lint:js -- --fix` diff --git a/app/components/add-contributor/component.js b/app/components/add-contributor/component.js index 646b4f3..32800c1 100644 --- a/app/components/add-contributor/component.js +++ b/app/components/add-contributor/component.js @@ -1,27 +1,12 @@ import Component from '@ember/component'; import { and, notEmpty } from '@ember/object/computed'; -import { inject as injectService } from '@ember/service'; +import { inject as service } from '@ember/service'; export default Component.extend({ - kredits: injectService(), + kredits: service(), - // Default attributes used by reset - attributes: { - account: null, - name: null, - kind: 'person', - url: null, - github_username: null, - github_uid: null, - wiki_username: null, - isCore: false, - }, - - didInsertElement() { - this._super(...arguments); - this.reset(); - }, + attributes: null, // TODO: add proper address validation isValidAccount: notEmpty('account'), @@ -36,6 +21,27 @@ export default Component.extend({ 'isValidGithubUID' ), + init () { + this._super(...arguments); + + // Default attributes used by reset + this.set('attributes', { + account: null, + name: null, + kind: 'person', + url: null, + github_username: null, + github_uid: null, + wiki_username: null, + isCore: false + }); + }, + + didInsertElement() { + this._super(...arguments); + this.reset(); + }, + reset: function() { this.setProperties(this.attributes); }, @@ -61,4 +67,5 @@ export default Component.extend({ }); } } + }); diff --git a/app/components/add-contributor/template.hbs b/app/components/add-contributor/template.hbs index c47fd92..235c535 100644 --- a/app/components/add-contributor/template.hbs +++ b/app/components/add-contributor/template.hbs @@ -13,7 +13,7 @@ type="text" placeholder="0xF18E631Ea191aE4ebE70046Fcb01a436554421BA4" value=account - class=(if isValidAccount 'valid' '')}} + class=(if isValidAccount "valid" "")}}