Skip to content

Commit df9d48d

Browse files
authored
Merge pull request #583 from mixonic/update-to-eslint
Update to eslint
2 parents bc4658f + d67946b commit df9d48d

33 files changed

Lines changed: 893 additions & 306 deletions

.eslintrc.js

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
module.exports = {
2+
root: true,
3+
parserOptions: {
4+
ecmaVersion: 2017,
5+
sourceType: 'module'
6+
},
7+
plugins: [
8+
'ember'
9+
],
10+
extends: [
11+
'eslint:recommended',
12+
'plugin:ember/recommended'
13+
],
14+
env: {
15+
browser: true
16+
},
17+
globals: {
18+
andThen: true,
19+
click: true,
20+
createGist: true,
21+
currentRouteName: true,
22+
currentURL: true,
23+
fillIn: true,
24+
keyEvent: true,
25+
outputContents: true,
26+
outputPane: true,
27+
runGist: true,
28+
runRevision: true,
29+
server: true,
30+
triggerEvent: true,
31+
visit: true,
32+
waitForLoadedIFrame: true,
33+
waitForUnloadedIFrame: true,
34+
'$': true
35+
},
36+
rules: {
37+
'ember/new-module-imports': 'off'
38+
},
39+
overrides: [
40+
// node files
41+
{
42+
files: [
43+
'testem.js',
44+
'ember-cli-build.js',
45+
'config/**/*.js',
46+
'lib/*/index.js'
47+
],
48+
parserOptions: {
49+
sourceType: 'script',
50+
ecmaVersion: 2015
51+
},
52+
env: {
53+
browser: false,
54+
node: true
55+
}
56+
},
57+
// mirage files
58+
{
59+
files: ['mirage/**'],
60+
rules: {
61+
'ember/avoid-leaking-state-in-ember-objects': 'off'
62+
}
63+
}
64+
]
65+
};

.jshintrc

Lines changed: 0 additions & 33 deletions
This file was deleted.

.travis.yml

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1+
---
12
language: node_js
23
node_js:
3-
- '6'
4+
- "6"
5+
46
notifications:
57
email: false
8+
9+
sudo: required
610
dist: trusty
7-
sudo: false
811

912
addons:
1013
chrome: stable
1114

15+
cache:
16+
yarn: true
17+
1218
env:
1319
global:
1420
# See https://git.io/vdao3 for details.
1521
- JOBS=1
1622

17-
cache:
18-
yarn: true
19-
directories:
20-
- $HOME/.npm
21-
- $HOME/.cache
22-
2323
before_install:
2424
- curl -o- -L https://yarnpkg.com/install.sh | bash
2525
- export PATH=$HOME/.yarn/bin:$PATH
@@ -28,23 +28,19 @@ before_install:
2828
- yarn --version
2929

3030
install:
31-
- yarn
32-
- bower install
33-
34-
before_script:
35-
- export DISPLAY=:99.0
36-
- sh -e /etc/init.d/xvfb start
37-
- sleep 3 # give xvfb some time to start
31+
- yarn install --non-interactive
32+
- bower install
3833

3934
script:
40-
- yarn test
35+
- yarn lint:js
36+
- yarn test
4137

4238
after_script:
43-
- scripts/travis-deploy.sh
39+
- scripts/travis-deploy.sh
4440

4541
env:
4642
global:
47-
- TORII_PROVIDER=github-oauth2
48-
- secure: Dwthqo6GaXQt7erj89xMa/2GRua9PTzcSKXYmxjE0O46DMuBR80JjPges0hGCWwPcdMFqsaMshSaTVF5eHc49vhaziB2sqWwLZndkRFIAsNGnBZkBpeZc9MsTNMbPP5KyJh/pG03nJLXUSz6xzMoxDNU/QHWyBYBxTlfxVGewLE=
49-
- secure: H3EtrTdcXIDOjp59Mu/7KA7N2UrVgKjt2YVtW6dqby/Oa5q/jpfnomE70fhIpFTle6MavhAIujQ5awMRC/80EJXlZp5hnSd9DKyCpk70I1KoT6vm34RjZfSP9kAyRyokLwfjEkovCFltY3/i8y+8QFEVr8RkNt1VP2hY1ScFzys=
50-
- secure: BM5IGMNaE+xS16wsReX6KjA4Zg9nKhWrPuc7AZAmgEevCiQT6mgSfyhyoPoRS/M5UVdngqCSHFljfUHigR9/C8lPOY7fS6RU4wyNnZlQJL6y3D3LMWvzw8u/Rc98rmoWqNA2XEmc4a95A8iRNATWQAd3qL0FxfNcv6ny99MOER4=
43+
- TORII_PROVIDER=github-oauth2
44+
- secure: Dwthqo6GaXQt7erj89xMa/2GRua9PTzcSKXYmxjE0O46DMuBR80JjPges0hGCWwPcdMFqsaMshSaTVF5eHc49vhaziB2sqWwLZndkRFIAsNGnBZkBpeZc9MsTNMbPP5KyJh/pG03nJLXUSz6xzMoxDNU/QHWyBYBxTlfxVGewLE=
45+
- secure: H3EtrTdcXIDOjp59Mu/7KA7N2UrVgKjt2YVtW6dqby/Oa5q/jpfnomE70fhIpFTle6MavhAIujQ5awMRC/80EJXlZp5hnSd9DKyCpk70I1KoT6vm34RjZfSP9kAyRyokLwfjEkovCFltY3/i8y+8QFEVr8RkNt1VP2hY1ScFzys=
46+
- secure: BM5IGMNaE+xS16wsReX6KjA4Zg9nKhWrPuc7AZAmgEevCiQT6mgSfyhyoPoRS/M5UVdngqCSHFljfUHigR9/C8lPOY7fS6RU4wyNnZlQJL6y3D3LMWvzw8u/Rc98rmoWqNA2XEmc4a95A8iRNATWQAd3qL0FxfNcv6ny99MOER4=

app/components/better-checkbox.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ export default Ember.Component.extend({
99

1010
change() {
1111
this.set('checked', this.$().prop('checked'));
12-
this.attrs.action(this.get('checked'));
12+
this.action(this.get('checked'));
1313
}
1414
});

app/components/build-messages.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export default Ember.Component.extend({
77
actions: {
88
showErrors() {
99
this.get('buildErrors').forEach((error) => {
10+
// eslint-disable-next-line no-console
1011
console.error(error);
1112
});
1213
this.get('notify').info('Errors were dumped to console');

app/components/dummy-app.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import Ember from 'ember';
22
import ResizeMixin from 'ember-twiddle/mixins/resize';
3+
import $ from 'jquery';
34

4-
const { $, on, inject } = Ember;
5+
const { inject } = Ember;
56

67
export default Ember.Component.extend(ResizeMixin, {
78
app: inject.service(),
@@ -55,7 +56,8 @@ export default Ember.Component.extend(ResizeMixin, {
5556
}
5657
},
5758

58-
didResize: on('didInsertElement', function () {
59+
didInsertElement() {
60+
this._super();
5961
let offset = this.$().offset(), width = this.$().width(),
6062
height = this.$().height();
6163

@@ -65,10 +67,10 @@ export default Ember.Component.extend(ResizeMixin, {
6567
width: width,
6668
height: height
6769
});
68-
}),
70+
},
6971

7072
willDestroyElement() {
71-
this._super(...arguments);
73+
this._super();
7274

7375
let oldIframe = document.getElementById(this.iframeId);
7476
if (oldIframe) {

app/components/editor-mode-menu.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default Ember.Component.extend({
66

77
actions: {
88
setKeyMap(keyMap) {
9-
this.attrs.setKeyMap(keyMap);
9+
this.setKeyMap(keyMap);
1010
}
1111
}
1212
});

app/components/file-editor-column.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,30 +32,30 @@ export default Ember.Component.extend({
3232
}),
3333

3434
focusIn () {
35-
this.sendAction('focusEditor', this);
35+
this.focusEditor(this);
3636
},
3737

3838
actions: {
3939
selectFile(file) {
4040
this.set('file', file);
41-
this.sendAction('selectFile', file);
41+
this.selectFile(file);
4242
},
4343

4444
valueUpdated(value, __, changeObj) {
4545
const isUserChange = changeObj.origin !== 'setValue';
46-
this.get('contentChanged')(isUserChange, value);
46+
this.contentChanged(isUserChange, value);
4747
},
4848

4949
removeColumn(col) {
50-
this.get('removeColumn')(col);
50+
this.removeColumn(col);
5151
},
5252

5353
addColumn() {
54-
this.get('addColumn')();
54+
this.addColumn();
5555
},
5656

5757
showFileTree() {
58-
this.get('showFileTree')();
58+
this.showFileTree();
5959
}
6060
}
6161
});

app/components/file-menu.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,31 +16,31 @@ export default Ember.Component.extend(DropdownSubmenuFixMixin, {
1616

1717
actions: {
1818
addComponent() {
19-
this.attrs.addComponent();
19+
this.addComponent();
2020
},
2121
addHelper() {
22-
this.attrs.addHelper();
22+
this.addHelper();
2323
},
2424
addFile(type) {
25-
this.attrs.addFile(type);
25+
this.addFile(type);
2626
},
2727
addUnitTestFile(type) {
28-
this.attrs.addUnitTestFile(type);
28+
this.addUnitTestFile(type);
2929
},
3030
addIntegrationTestFile(type) {
31-
this.attrs.addIntegrationTestFile(type);
31+
this.addIntegrationTestFile(type);
3232
},
3333
addAcceptanceTestFile() {
34-
this.attrs.addAcceptanceTestFile();
34+
this.addAcceptanceTestFile();
3535
},
3636
renameFile(file) {
37-
this.attrs.renameFile(file);
37+
this.renameFile(file);
3838
},
3939
removeFile(file) {
40-
this.attrs.removeFile(file);
40+
this.removeFile(file);
4141
},
4242
saveGist(model) {
43-
this.attrs.saveGist(model);
43+
this.saveGist(model);
4444
},
4545
share() {
4646
prompt('Ctrl + C ;-)', window.location.href);
@@ -58,25 +58,25 @@ export default Ember.Component.extend(DropdownSubmenuFixMixin, {
5858
prompt('Ctrl + C ;-)', embedCode);
5959
},
6060
fork(model) {
61-
this.attrs.fork(model);
61+
this.fork(model);
6262
},
6363
copy() {
64-
this.attrs.copy();
64+
this.copy();
6565
},
6666
deleteGist(model) {
67-
this.attrs.deleteGist(model);
67+
this.deleteGist(model);
6868
},
6969
signInViaGithub() {
70-
this.attrs.signInViaGithub();
70+
this.signInViaGithub();
7171
},
7272
showRevision(id) {
73-
this.attrs.showRevision(id);
73+
this.showRevision(id);
7474
},
7575
showCurrentVersion() {
76-
this.attrs.showCurrentVersion();
76+
this.showCurrentVersion();
7777
},
7878
downloadProject() {
79-
this.attrs.downloadProject();
79+
this.downloadProject();
8080
}
8181
}
8282
});

app/components/file-tree.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,26 +90,26 @@ export default Ember.Component.extend({
9090
actions: {
9191
handleSelectTreeNode(node) {
9292
if (node.original.leaf) {
93-
this.attrs.openFile(node.original.path);
93+
this.openFile(node.original.path);
9494
return;
9595
}
9696
this.get('jsTreeActionReceiver').send('toggleNode', node.id);
9797
},
9898

9999
didBecomeReady() {
100-
if(this.attrs.didBecomeReady) {
101-
this.attrs.didBecomeReady();
100+
if(this.didBecomeReady) {
101+
this.didBecomeReady();
102102
}
103103
},
104104

105105
didChange() {
106-
if (this.attrs.didChange) {
107-
this.attrs.didChange();
106+
if (this.didChange) {
107+
this.didChange();
108108
}
109109
},
110110

111111
hideFileTree() {
112-
this.attrs.hideFileTree();
112+
this.hideFileTree();
113113
},
114114

115115
expandAll() {

0 commit comments

Comments
 (0)