Permalink
Browse files

ESLint: Adjust config files

  • Loading branch information...
1 parent f9ee10c commit 9ef4a47c4dd0640cacc86b57d0fef9606d19f691 @Turbo87 Turbo87 committed Aug 9, 2016
Showing with 375 additions and 422 deletions.
  1. +0 −47 .eslintrc
  2. +119 −0 .eslintrc.js
  3. +2 −3 app/adapters/basic.js
  4. +2 −2 app/adapters/bookmarklet.js
  5. +1 −1 app/adapters/firefox.js
  6. +1 −3 app/adapters/websocket.js
  7. +1 −1 app/app.js
  8. +1 −1 app/components/deprecation-item-source.js
  9. +5 −5 app/components/drag-handle.js
  10. +2 −1 app/components/draggable-column.js
  11. +2 −2 app/components/main-content.js
  12. +1 −1 app/components/mixin-property.js
  13. +1 −1 app/components/object-inspector.js
  14. +3 −2 app/components/promise-item.js
  15. +1 −3 app/components/record-item.js
  16. +7 −6 app/components/render-item.js
  17. +1 −1 app/components/route-item.js
  18. +1 −1 app/components/x-list-content.js
  19. +2 −1 app/controllers/application.js
  20. +2 −1 app/controllers/promise-tree.js
  21. +2 −2 app/controllers/records.js
  22. +2 −2 app/controllers/route-tree.js
  23. +1 −1 app/helpers/ms-to-time.js
  24. +1 −3 app/libs/promise-assembler.js
  25. +3 −3 app/models/promise.js
  26. +5 −5 app/routes/application.js
  27. +1 −1 app/routes/info.js
  28. +1 −1 app/routes/tab.js
  29. +1 −1 app/utils/check-current-route.js
  30. +1 −1 ember-cli-build.js
  31. +0 −4 ember_debug/.eslintrc
  32. +4 −0 ember_debug/.eslintrc.js
  33. +4 −5 ember_debug/adapters/basic.js
  34. +2 −2 ember_debug/adapters/firefox.js
  35. +2 −2 ember_debug/addons/ember-new-computed/utils/can-use-new-syntax.js
  36. +6 −8 ember_debug/container-debug.js
  37. +9 −17 ember_debug/data-debug.js
  38. +8 −15 ember_debug/deprecation-debug.js
  39. +5 −16 ember_debug/libs/promise-assembler.js
  40. +2 −4 ember_debug/libs/source-map.js
  41. +2 −0 ember_debug/main.js
  42. +1 −1 ember_debug/mixins/port-mixin.js
  43. +1 −4 ember_debug/models/profile-manager.js
  44. +29 −48 ember_debug/object-inspector.js
  45. +1 −1 ember_debug/port.js
  46. +5 −11 ember_debug/promise-debug.js
  47. +7 −9 ember_debug/render-debug.js
  48. +9 −9 ember_debug/route-debug.js
  49. +4 −4 ember_debug/services/session.js
  50. +31 −38 ember_debug/view-debug.js
  51. +0 −45 tests/.eslintrc
  52. +12 −0 tests/.eslintrc.js
  53. +2 −2 tests/acceptance/data-test.js
  54. +1 −1 tests/acceptance/deprecation-test.js
  55. +5 −21 tests/acceptance/object-inspector-test.js
  56. +1 −1 tests/acceptance/promise-test.js
  57. +1 −1 tests/acceptance/render-tree-test.js
  58. +5 −5 tests/acceptance/route-tree-test.js
  59. +7 −9 tests/acceptance/view-tree-test.js
  60. +2 −2 tests/ember_debug/container-debug-test.js
  61. +5 −8 tests/ember_debug/deprecation-debug-test.js
  62. +2 −2 tests/ember_debug/ember-debug-test.js
  63. +8 −7 tests/ember_debug/object-inspector-test.js
  64. +1 −1 tests/ember_debug/profile-manager-test.js
  65. +1 −1 tests/ember_debug/profile-node-test.js
  66. +5 −5 tests/ember_debug/promise-debug-test.js
  67. +2 −2 tests/ember_debug/render-debug-test.js
  68. +3 −3 tests/ember_debug/route-debug-test.js
  69. +3 −3 tests/ember_debug/view-debug-test.js
  70. +4 −2 tests/helpers/start-app.js
View
@@ -1,47 +0,0 @@
-{
- "root": true,
- "parserOptions": {
- "ecmaVersion": 6,
- "sourceType": "module"
- },
- "extends": "eslint:recommended",
- "env": {
- "browser": true
- },
- "rules": {
- "no-eq-null": 0,
- "eqeqeq": [2, "allow-null"],
- "no-implicit-coercion": 0,
- "spaced-comment": 0,
- "arrow-spacing": [ 2, { "before": true, "after": true } ],
- "prefer-reflect": 0,
- "prefer-const": 0,
- "no-restricted-syntax": [2, "WithStatement"],
- "object-curly-spacing": [ 2, "always" ],
- "no-console": 0,
- "no-multiple-empty-lines": 0,
- "max-len": [2, 250],
- "no-shadow": 0,
- "max-nested-callbacks": [2, 5],
- "guard-for-in": 0,
- "no-extend-native": 0,
- "no-unused-vars": 0,
- "no-param-reassign": 0,
- "block-scoped-var": 0,
- "no-ternary": 0,
- "no-else-return": 0,
- "space-in-parens": 0,
- "no-undefined": 0,
- "brace-style": 0,
- "consistent-return": 0,
- "no-use-before-define": 0,
- "consistent-this": 0,
- "no-underscore-dangle": 0,
- "valid-jsdoc": 0,
- "quotes": 0,
- "one-var": 0,
- "newline-after-var": 0,
- "no-warning-comments": 0,
- "space-before-function-paren": 0
- }
-}
View
@@ -0,0 +1,119 @@
+module.exports = {
+ root: true,
+ parserOptions: {
+ ecmaVersion: 6,
+ sourceType: 'module'
+ },
+ extends: 'eslint:recommended',
+ env: {
+ 'browser': true
+ },
+ rules: {
+ /* Possible Errors */
+
+ 'no-console': 0,
+
+ /* Best Practices */
+
+ 'eqeqeq': 2,
+ 'no-eq-null': 2,
+ 'no-labels': 2,
+ 'no-multi-spaces': 2,
+ 'no-new': 2,
+ 'no-new-func': 2,
+ 'no-new-wrappers': 2,
+ 'no-octal-escape': 2,
+ 'no-proto': 2,
+ 'no-return-assign': 2,
+ 'no-script-url': 2,
+ 'no-self-compare': 2,
+ 'no-sequences': 2,
+ 'no-throw-literal': 2,
+ 'no-unused-expressions': 2,
+ 'no-useless-call': 2,
+ 'no-useless-concat': 2,
+ 'no-useless-escape': 2,
+ 'no-void': 2,
+ 'no-with': 2,
+ 'yoda': 2,
+
+ /* Variables */
+
+ 'no-shadow': 0,
+ 'no-use-before-define': [2, {
+ 'classes': false,
+ 'functions': false,
+ }],
+
+ /* Stylistic Issues */
+
+ 'array-bracket-spacing': 2,
+ 'block-spacing': 2,
+ 'camelcase': [0, {
+ 'properties': 'always',
+ }],
+ 'comma-spacing': [2, {
+ 'before': false,
+ 'after': true,
+ }],
+ 'comma-style': 2,
+ 'computed-property-spacing': 2,
+ 'eol-last': 2,
+ 'indent': [2, 2, {
+ 'VariableDeclarator': {
+ 'var': 2,
+ 'let': 2,
+ 'const': 3,
+ }
+ }],
+ 'key-spacing': [2, {
+ 'beforeColon': false,
+ 'afterColon': true,
+ }],
+ 'keyword-spacing': 2,
+ 'linebreak-style': [2, 'unix'],
+ 'max-len': [2, 250],
+ 'max-nested-callbacks': [2, 5],
+ 'new-cap': [2, {
+ 'capIsNew': false,
+ }],
+ 'new-parens': 2,
+ 'no-array-constructor': 2,
+ 'no-bitwise': 2,
+ 'no-inline-comments': 0,
+ 'no-new-object': 2,
+ 'no-restricted-syntax': [2, 'WithStatement'],
+ 'no-spaced-func': 2,
+ 'no-trailing-spaces': 2,
+ 'no-unneeded-ternary': 2,
+ 'no-whitespace-before-property': 2,
+ 'object-curly-spacing': [2, 'always'],
+ 'operator-assignment': 2,
+ 'semi': 2,
+ 'semi-spacing': 2,
+ 'space-before-blocks': 2,
+ 'space-in-parens': 2,
+ 'space-infix-ops': 2,
+ 'space-unary-ops': 2,
+ 'wrap-regex': 2,
+
+ /* ECMAScript 6 */
+
+ 'arrow-body-style': 2,
+ 'arrow-spacing': 2,
+ 'constructor-super': 2,
+ 'no-confusing-arrow': [2, {
+ 'allowParens': true
+ }],
+ 'no-const-assign': 2,
+ 'no-dupe-class-members': 2,
+ 'no-duplicate-imports': 2,
+ 'no-new-symbol': 2,
+ 'no-var': 2,
+ 'object-shorthand': 2,
+ 'prefer-spread': 2,
+ 'prefer-template': 2,
+ 'require-yield': 2,
+ 'template-curly-spacing': 2,
+ },
+};
@@ -117,11 +117,10 @@ export default Ember.Object.extend({
* @return {Boolean} result of the comparison
*/
function compareVersion(version1, version2) {
- var compared, i;
version1 = cleanupVersion(version1).split('.');
version2 = cleanupVersion(version2).split('.');
- for (i = 0; i < 3; i++) {
- compared = compare(+version1[i], +version2[i]);
+ for (let i = 0; i < 3; i++) {
+ let compared = compare(+version1[i], +version2[i]);
if (compared !== 0) {
return compared;
}
@@ -36,7 +36,7 @@ export default BasicAdapter.extend({
*/
onVersionMismatch(goToVersion) {
this.sendMessage({ name: 'version-mismatch', version: goToVersion });
- window.location.href = `../panes-${goToVersion.replace(/\./g, '-')}/index.html` + window.location.search;
+ window.location.href = `../panes-${goToVersion.replace(/\./g, '-')}/index.html${window.location.search}`;
},
_connect() {
@@ -58,5 +58,5 @@ export default BasicAdapter.extend({
function loadPageVar (sVar) {
- return decodeURI(window.location.search.replace(new RegExp("^(?:.*[&\\?]" + encodeURI(sVar).replace(/[\.\+\*]/g, "\\$&") + "(?:\\=([^&]*))?)?.*$", "i"), "$1"));
+ return decodeURI(window.location.search.replace(new RegExp(`^(?:.*[&\\?]${encodeURI(sVar).replace(/[\.\+\*]/g, "\\$&")}(?:\\=([^&]*))?)?.*$`, "i"), "$1"));
}
@@ -71,7 +71,7 @@ export default BasicAdapter.extend({
this.sendMessage({
type: 'devtools:openSource',
url: file,
- line: line
+ line
});
}
@@ -13,9 +13,7 @@ export default BasicAdapter.extend({
this.get('socket').emit('emberInspectorMessage', options);
},
- socket: computed(() => {
- return window.EMBER_INSPECTOR_CONFIG.remoteDebugSocket;
- }),
+ socket: computed(() => window.EMBER_INSPECTOR_CONFIG.remoteDebugSocket),
_connect() {
this.get('socket').on('emberInspectorMessage', message => {
View
@@ -42,7 +42,7 @@ App.initializer({
// register and inject adapter
let Adapter;
if (Ember.typeOf(instance.adapter) === 'string') {
- Adapter = instance.resolveRegistration('adapter:' + instance.adapter);
+ Adapter = instance.resolveRegistration(`adapter:${instance.adapter}`);
} else {
Adapter = instance.adapter;
}
@@ -8,7 +8,7 @@ export default Component.extend({
url: computed('model.map.source', 'model.map.line', 'known', function() {
let source = this.get('model.map.source');
if (this.get('known')) {
- return source + ':' + this.get('model.map.line');
+ return `${source}:${this.get('model.map.line')}`;
} else {
return 'Unkown source';
}
@@ -14,11 +14,11 @@ export default Ember.Component.extend({
let $container = this.$().parent();
let $containerOffsetLeft = $container.offset().left;
let $containerOffsetRight = $containerOffsetLeft + $container.width();
- let namespace = 'drag-' + this.get('elementId');
+ let namespace = `drag-${this.get('elementId')}`;
this.sendAction('action', true);
- Ember.$('body').on('mousemove.' + namespace, e => {
+ Ember.$('body').on(`mousemove.${namespace}`, e => {
let position = this.get('isLeft') ?
e.pageX - $containerOffsetLeft :
$containerOffsetRight - e.pageX;
@@ -27,17 +27,17 @@ export default Ember.Component.extend({
this.set('position', position);
}
})
- .on('mouseup.' + namespace + ' mouseleave.' + namespace, () => {
+ .on(`mouseup.${namespace} mouseleave.${namespace}`, () => {
this.stopDragging();
});
},
stopDragging() {
this.sendAction('action', false);
- Ember.$('body').off('.drag-' + this.get('elementId'));
+ Ember.$('body').off(`.drag-${this.get('elementId')}`);
},
- willDestroyElement: function() {
+ willDestroyElement() {
this._super();
this.stopDragging();
},
@@ -3,7 +3,8 @@
// A wrapper for a resizable-column and a drag-handle component
import Ember from "ember";
-const { Component, computed } = Ember;
+
+const { Component } = Ember;
export default Component.extend({
tagName: '', // Prevent wrapping in a div
@@ -12,7 +12,7 @@ export default Component.extend({
updateHeight: null,
didInsertElement() {
- $(window).on('resize.view-' + this.get('elementId'), () => {
+ $(window).on(`resize.view-${this.get('elementId')}`, () => {
this._updateHeightDebounce = debounce(this, '_updateHeight', 200);
});
schedule('afterRender', this, '_updateHeight');
@@ -24,7 +24,7 @@ export default Component.extend({
},
willDestroyElement() {
- $(window).off('.view-' + this.get('elementId'));
+ $(window).off(`.view-${this.get('elementId')}`);
cancel(this._updateHeightDebounce);
return this._super(...arguments);
}
@@ -66,7 +66,7 @@ export default Component.extend({
let value = this.get('model.value.inspect');
let type = this.get('model.value.type');
if (type === 'type-string') {
- value = '"' + value + '"';
+ value = `"${value}"`;
}
if (!this.get('isDate')) {
this.set('txtValue', value);
@@ -16,7 +16,7 @@ export default Component.extend({
trail: computed('model.[]', function() {
let nested = this.get('model').slice(1);
if (nested.length === 0) { return ""; }
- return "." + nested.mapBy('property').join(".");
+ return `.${nested.mapBy('property').join(".")}`;
}),
isNested: computed('model.[]', function() {
@@ -1,6 +1,7 @@
import Ember from "ember";
-const { Component, computed, String: { htmlSafe }, getOwner, isEmpty } = Ember;
-const { alias, notEmpty, empty, gt, equal } = computed;
+
+const { Component, computed, String: { htmlSafe }, isEmpty } = Ember;
+const { notEmpty, gt, equal } = computed;
const COLOR_MAP = {
red: '#ff2717',
@@ -26,9 +26,7 @@ export default Component.extend({
columns: computed('modelTypeColumns.[]', 'model.columnValues', function() {
let columns = this.get('modelTypeColumns') || [];
- return columns.map(col => {
- return { name: col.name, value: this.get('model.columnValues.' + col.name) };
- });
+ return columns.map(col => ({ name: col.name, value: this.get(`model.columnValues.${col.name}`) }));
}),
click() {
@@ -1,7 +1,8 @@
import Ember from 'ember';
import escapeRegExp from "ember-inspector/utils/escape-reg-exp";
-const { Component, computed, isEmpty, run, on, observer, String: { htmlSafe } } = Ember;
-const { gt, readOnly } = computed;
+
+const { Component, computed, isEmpty, isNone, run, on, observer, String: { htmlSafe } } = Ember;
+const { gt } = computed;
const { once } = run;
export default Component.extend({
@@ -42,7 +43,7 @@ export default Component.extend({
level: computed('target.level', function() {
let parentLevel = this.get('target.level');
- if (parentLevel == null) {
+ if (isNone(parentLevel)) {
parentLevel = -1;
}
return parentLevel + 1;
@@ -68,10 +69,10 @@ export default Component.extend({
let d = new Date(this.get('model.timestamp'));
let ms = d.getMilliseconds();
let seconds = d.getSeconds();
- let minutes = d.getMinutes().toString().length === 1 ? '0' + d.getMinutes() : d.getMinutes();
- let hours = d.getHours().toString().length === 1 ? '0' + d.getHours() : d.getHours();
+ let minutes = d.getMinutes().toString().length === 1 ? `0${d.getMinutes()}` : d.getMinutes();
+ let hours = d.getHours().toString().length === 1 ? `0${d.getHours()}` : d.getHours();
- return hours + ':' + minutes + ':' + seconds + ':' + ms;
+ return `${hours}:${minutes}:${seconds}:${ms}`;
}),
actions: {
@@ -19,6 +19,6 @@ export default Component.extend({
return false;
}
- return checkCurrentRoute( currentRoute, this.get('model.value.name') );
+ return checkCurrentRoute(currentRoute, this.get('model.value.name'));
})
});
@@ -1,6 +1,6 @@
import Ember from 'ember';
-const { Component, computed, computed: { readOnly }, String: { htmlSafe } } = Ember;
+const { Component, computed, String: { htmlSafe } } = Ember;
/**
* Base list view config
@@ -1,5 +1,6 @@
import Ember from "ember";
-const { Controller, computed, computed: { equal }, inject: { controller } } = Ember;
+
+const { Controller, computed, computed: { equal } } = Ember;
export default Controller.extend({
isDragging: false,
Oops, something went wrong.

0 comments on commit 9ef4a47

Please sign in to comment.