Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to eslint #583

Merged
merged 4 commits into from
Mar 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
module.exports = {
root: true,
parserOptions: {
ecmaVersion: 2017,
sourceType: 'module'
},
plugins: [
'ember'
],
extends: [
'eslint:recommended',
'plugin:ember/recommended'
],
env: {
browser: true
},
globals: {
andThen: true,
click: true,
createGist: true,
currentRouteName: true,
currentURL: true,
fillIn: true,
keyEvent: true,
outputContents: true,
outputPane: true,
runGist: true,
runRevision: true,
server: true,
triggerEvent: true,
visit: true,
waitForLoadedIFrame: true,
waitForUnloadedIFrame: true,
'$': true
},
rules: {
'ember/new-module-imports': 'off'
},
overrides: [
// node files
{
files: [
'testem.js',
'ember-cli-build.js',
'config/**/*.js',
'lib/*/index.js'
],
parserOptions: {
sourceType: 'script',
ecmaVersion: 2015
},
env: {
browser: false,
node: true
}
},
// mirage files
{
files: ['mirage/**'],
rules: {
'ember/avoid-leaking-state-in-ember-objects': 'off'
}
}
]
};
33 changes: 0 additions & 33 deletions .jshintrc

This file was deleted.

38 changes: 17 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
---
language: node_js
node_js:
- '6'
- "6"

notifications:
email: false

sudo: required
dist: trusty
sudo: false

addons:
chrome: stable

cache:
yarn: true

env:
global:
# See https://git.io/vdao3 for details.
- JOBS=1

cache:
yarn: true
directories:
- $HOME/.npm
- $HOME/.cache

before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH=$HOME/.yarn/bin:$PATH
Expand All @@ -28,23 +28,19 @@ before_install:
- yarn --version

install:
- yarn
- bower install

before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- sleep 3 # give xvfb some time to start
- yarn install --non-interactive
- bower install

script:
- yarn test
- yarn lint:js
- yarn test

after_script:
- scripts/travis-deploy.sh
- scripts/travis-deploy.sh

env:
global:
- TORII_PROVIDER=github-oauth2
- secure: Dwthqo6GaXQt7erj89xMa/2GRua9PTzcSKXYmxjE0O46DMuBR80JjPges0hGCWwPcdMFqsaMshSaTVF5eHc49vhaziB2sqWwLZndkRFIAsNGnBZkBpeZc9MsTNMbPP5KyJh/pG03nJLXUSz6xzMoxDNU/QHWyBYBxTlfxVGewLE=
- secure: H3EtrTdcXIDOjp59Mu/7KA7N2UrVgKjt2YVtW6dqby/Oa5q/jpfnomE70fhIpFTle6MavhAIujQ5awMRC/80EJXlZp5hnSd9DKyCpk70I1KoT6vm34RjZfSP9kAyRyokLwfjEkovCFltY3/i8y+8QFEVr8RkNt1VP2hY1ScFzys=
- secure: BM5IGMNaE+xS16wsReX6KjA4Zg9nKhWrPuc7AZAmgEevCiQT6mgSfyhyoPoRS/M5UVdngqCSHFljfUHigR9/C8lPOY7fS6RU4wyNnZlQJL6y3D3LMWvzw8u/Rc98rmoWqNA2XEmc4a95A8iRNATWQAd3qL0FxfNcv6ny99MOER4=
- TORII_PROVIDER=github-oauth2
- secure: Dwthqo6GaXQt7erj89xMa/2GRua9PTzcSKXYmxjE0O46DMuBR80JjPges0hGCWwPcdMFqsaMshSaTVF5eHc49vhaziB2sqWwLZndkRFIAsNGnBZkBpeZc9MsTNMbPP5KyJh/pG03nJLXUSz6xzMoxDNU/QHWyBYBxTlfxVGewLE=
- secure: H3EtrTdcXIDOjp59Mu/7KA7N2UrVgKjt2YVtW6dqby/Oa5q/jpfnomE70fhIpFTle6MavhAIujQ5awMRC/80EJXlZp5hnSd9DKyCpk70I1KoT6vm34RjZfSP9kAyRyokLwfjEkovCFltY3/i8y+8QFEVr8RkNt1VP2hY1ScFzys=
- secure: BM5IGMNaE+xS16wsReX6KjA4Zg9nKhWrPuc7AZAmgEevCiQT6mgSfyhyoPoRS/M5UVdngqCSHFljfUHigR9/C8lPOY7fS6RU4wyNnZlQJL6y3D3LMWvzw8u/Rc98rmoWqNA2XEmc4a95A8iRNATWQAd3qL0FxfNcv6ny99MOER4=
2 changes: 1 addition & 1 deletion app/components/better-checkbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ export default Ember.Component.extend({

change() {
this.set('checked', this.$().prop('checked'));
this.attrs.action(this.get('checked'));
this.action(this.get('checked'));
}
});
1 change: 1 addition & 0 deletions app/components/build-messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export default Ember.Component.extend({
actions: {
showErrors() {
this.get('buildErrors').forEach((error) => {
// eslint-disable-next-line no-console
console.error(error);
});
this.get('notify').info('Errors were dumped to console');
Expand Down
10 changes: 6 additions & 4 deletions app/components/dummy-app.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import Ember from 'ember';
import ResizeMixin from 'ember-twiddle/mixins/resize';
import $ from 'jquery';

const { $, on, inject } = Ember;
const { inject } = Ember;

export default Ember.Component.extend(ResizeMixin, {
app: inject.service(),
Expand Down Expand Up @@ -55,7 +56,8 @@ export default Ember.Component.extend(ResizeMixin, {
}
},

didResize: on('didInsertElement', function () {
didInsertElement() {
this._super();
let offset = this.$().offset(), width = this.$().width(),
height = this.$().height();

Expand All @@ -65,10 +67,10 @@ export default Ember.Component.extend(ResizeMixin, {
width: width,
height: height
});
}),
},

willDestroyElement() {
this._super(...arguments);
this._super();

let oldIframe = document.getElementById(this.iframeId);
if (oldIframe) {
Expand Down
2 changes: 1 addition & 1 deletion app/components/editor-mode-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default Ember.Component.extend({

actions: {
setKeyMap(keyMap) {
this.attrs.setKeyMap(keyMap);
this.setKeyMap(keyMap);
}
}
});
12 changes: 6 additions & 6 deletions app/components/file-editor-column.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,30 +32,30 @@ export default Ember.Component.extend({
}),

focusIn () {
this.sendAction('focusEditor', this);
this.focusEditor(this);
},

actions: {
selectFile(file) {
this.set('file', file);
this.sendAction('selectFile', file);
this.selectFile(file);
},

valueUpdated(value, __, changeObj) {
const isUserChange = changeObj.origin !== 'setValue';
this.get('contentChanged')(isUserChange, value);
this.contentChanged(isUserChange, value);
},

removeColumn(col) {
this.get('removeColumn')(col);
this.removeColumn(col);
},

addColumn() {
this.get('addColumn')();
this.addColumn();
},

showFileTree() {
this.get('showFileTree')();
this.showFileTree();
}
}
});
32 changes: 16 additions & 16 deletions app/components/file-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,31 @@ export default Ember.Component.extend(DropdownSubmenuFixMixin, {

actions: {
addComponent() {
this.attrs.addComponent();
this.addComponent();
},
addHelper() {
this.attrs.addHelper();
this.addHelper();
},
addFile(type) {
this.attrs.addFile(type);
this.addFile(type);
},
addUnitTestFile(type) {
this.attrs.addUnitTestFile(type);
this.addUnitTestFile(type);
},
addIntegrationTestFile(type) {
this.attrs.addIntegrationTestFile(type);
this.addIntegrationTestFile(type);
},
addAcceptanceTestFile() {
this.attrs.addAcceptanceTestFile();
this.addAcceptanceTestFile();
},
renameFile(file) {
this.attrs.renameFile(file);
this.renameFile(file);
},
removeFile(file) {
this.attrs.removeFile(file);
this.removeFile(file);
},
saveGist(model) {
this.attrs.saveGist(model);
this.saveGist(model);
},
share() {
prompt('Ctrl + C ;-)', window.location.href);
Expand All @@ -58,25 +58,25 @@ export default Ember.Component.extend(DropdownSubmenuFixMixin, {
prompt('Ctrl + C ;-)', embedCode);
},
fork(model) {
this.attrs.fork(model);
this.fork(model);
},
copy() {
this.attrs.copy();
this.copy();
},
deleteGist(model) {
this.attrs.deleteGist(model);
this.deleteGist(model);
},
signInViaGithub() {
this.attrs.signInViaGithub();
this.signInViaGithub();
},
showRevision(id) {
this.attrs.showRevision(id);
this.showRevision(id);
},
showCurrentVersion() {
this.attrs.showCurrentVersion();
this.showCurrentVersion();
},
downloadProject() {
this.attrs.downloadProject();
this.downloadProject();
}
}
});
12 changes: 6 additions & 6 deletions app/components/file-tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,26 +90,26 @@ export default Ember.Component.extend({
actions: {
handleSelectTreeNode(node) {
if (node.original.leaf) {
this.attrs.openFile(node.original.path);
this.openFile(node.original.path);
return;
}
this.get('jsTreeActionReceiver').send('toggleNode', node.id);
},

didBecomeReady() {
if(this.attrs.didBecomeReady) {
this.attrs.didBecomeReady();
if(this.didBecomeReady) {
this.didBecomeReady();
}
},

didChange() {
if (this.attrs.didChange) {
this.attrs.didChange();
if (this.didChange) {
this.didChange();
}
},

hideFileTree() {
this.attrs.hideFileTree();
this.hideFileTree();
},

expandAll() {
Expand Down
2 changes: 1 addition & 1 deletion app/components/title-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default Ember.Component.extend({
},

valueChanged() {
this.attrs.titleChanged();
this.titleChanged();
}
}

Expand Down
6 changes: 3 additions & 3 deletions app/components/user-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ export default Ember.Component.extend({

actions: {
signInViaGithub() {
this.attrs.signInViaGithub();
this.signInViaGithub();
},
signOut() {
this.attrs.signOut();
this.signOut();
},

showTwiddles() {
this.attrs.showTwiddles();
this.showTwiddles();
}
}
});
Loading