Skip to content

Commit

Permalink
eslint/ember-suave: sensibly configure and fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
buschtoens committed Jun 21, 2017
1 parent fd32329 commit 3d47c1c
Show file tree
Hide file tree
Showing 32 changed files with 80 additions and 43 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@ module.exports = {
browser: true
},
rules: {
'generator-star-spacing': ['error', { before: false, after: false }],
'ember-suave/require-access-in-comments': 'off',
'ember-suave/no-const-outside-module-scope': 'off'
}
};
1 change: 1 addition & 0 deletions addon/-private/global-options.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Ember from 'ember';
import config from 'ember-get-config';

// eslint-disable-next-line ember-suave/no-direct-property-access
const assign = Ember.assign || Ember.merge;
const globalOptions = config['ember-light-table'] || {};

Expand Down
3 changes: 2 additions & 1 deletion addon/-private/sync-array-proxy.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import Ember from 'ember';

const {
ArrayProxy,
assert,
isArray
} = Ember;

const EMPTY_ARRAY = [];

export default Ember.ArrayProxy.extend({
export default ArrayProxy.extend({
/**
* The model that will be synchronized to the content of this proxy
* @property syncArray
Expand Down
5 changes: 3 additions & 2 deletions addon/classes/Column.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ const {
isEmpty,
makeArray,
computed,
A: emberArray
A: emberArray,
Object: EmberObject
} = Ember;

/**
* @module Table
* @class Column
*/
export default class Column extends Ember.Object.extend({
export default class Column extends EmberObject.extend({
/**
* Whether the column can be hidden.
*
Expand Down
8 changes: 6 additions & 2 deletions addon/classes/Row.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import Ember from 'ember';

const { computed, guidFor } = Ember;
const {
computed,
guidFor,
ObjectProxy
} = Ember;

/**
* @module Table
* @extends Ember.ObjectProxy
* @class Row
*/
export default class Row extends Ember.ObjectProxy.extend({
export default class Row extends ObjectProxy.extend({
/**
* Whether the row is hidden.
*
Expand Down
5 changes: 3 additions & 2 deletions addon/classes/Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ const {
get,
computed,
isNone,
A: emberArray
A: emberArray,
Object: EmberObject
} = Ember;

const RowSyncArrayProxy = SyncArrayProxy.extend({
Expand All @@ -30,7 +31,7 @@ const RowSyncArrayProxy = SyncArrayProxy.extend({
* @module Table
* @class Table
*/
export default class Table extends Ember.Object.extend({
export default class Table extends EmberObject.extend({
/**
* @property columns
* @type {Ember.Array}
Expand Down
3 changes: 2 additions & 1 deletion addon/components/lt-column-resizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ import layout from '../templates/components/lt-column-resizer';

const {
$,
Component,
computed
} = Ember;

const TOP_LEVEL_CLASS = '.ember-light-table';

export default Ember.Component.extend({
export default Component.extend({
layout,
classNameBindings: [':lt-column-resizer', 'isResizing'],
column: null,
Expand Down
5 changes: 3 additions & 2 deletions addon/mixins/draggable-column.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ import Ember from 'ember';

const {
run,
computed
computed,
Mixin
} = Ember;

let sourceColumn;

export default Ember.Mixin.create({
export default Mixin.create({
classNameBindings: ['isDragging', 'isDragTarget', 'dragDirection'],
attributeBindings: ['isDraggable:draggable'],

Expand Down
5 changes: 3 additions & 2 deletions addon/mixins/table-header.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import Ember from 'ember';

const {
computed
computed,
Mixin
} = Ember;

/**
Expand All @@ -14,7 +15,7 @@ const {
* @private
*/

export default Ember.Mixin.create({
export default Mixin.create({
/**
* @property table
* @type {Table}
Expand Down
3 changes: 3 additions & 0 deletions tests/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@ module.exports = {
globals: {
$: false,
server: false
},
rules: {
'ember-suave/no-direct-property-access': 'off'
}
};
4 changes: 2 additions & 2 deletions tests/dummy/app/adapters/application.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import DS from 'ember-data';
import RESTAdapter from 'ember-data/adapters/rest';
import ENV from '../config/environment';

export default DS.RESTAdapter.extend({
export default RESTAdapter.extend({
namespace: `${ENV.rootURL}api`
});
8 changes: 4 additions & 4 deletions tests/dummy/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import Resolver from './resolver';
import loadInitializers from 'ember-load-initializers';
import config from './config/environment';

let App;
const {
Application
} = Ember;

Ember.MODEL_FACTORY_INJECTIONS = true;

App = Ember.Application.extend({
const App = Application.extend({
modulePrefix: config.modulePrefix,
podModulePrefix: config.podModulePrefix,
Resolver
Expand Down
1 change: 1 addition & 0 deletions tests/dummy/app/breakpoints.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable key-spacing */
export default {
mobile: '(max-width: 768px)',
tablet: '(min-width: 769px) and (max-width: 992px)',
Expand Down
4 changes: 3 additions & 1 deletion tests/dummy/app/components/code-panel.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import Ember from 'ember';
import layout from '../templates/components/code-panel';

export default Ember.Component.extend({
const { Component } = Ember;

export default Component.extend({
layout,
collapse: true,
title: '',
Expand Down
3 changes: 2 additions & 1 deletion tests/dummy/app/components/columns/draggable-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ import Ember from 'ember';
import TableCommon from '../../mixins/table-common';

const {
Component,
computed
} = Ember;

export default Ember.Component.extend(TableCommon, {
export default Component.extend(TableCommon, {
columns: computed(function() {
return [{
label: 'User Details',
Expand Down
3 changes: 2 additions & 1 deletion tests/dummy/app/components/columns/grouped-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ import Ember from 'ember';
import TableCommon from '../../mixins/table-common';

const {
Component,
computed
} = Ember;

export default Ember.Component.extend(TableCommon, {
export default Component.extend(TableCommon, {
columns: computed(function() {
return [{
label: 'User Details',
Expand Down
3 changes: 2 additions & 1 deletion tests/dummy/app/components/columns/resizable-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ import Ember from 'ember';
import TableCommon from '../../mixins/table-common';

const {
Component,
computed
} = Ember;

export default Ember.Component.extend(TableCommon, {
export default Component.extend(TableCommon, {
columns: computed(function() {
return [{
label: 'User Details',
Expand Down
3 changes: 2 additions & 1 deletion tests/dummy/app/components/cookbook/client-side-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import TableCommon from '../../mixins/table-common';
import { task, timeout } from 'ember-concurrency';

const {
Component,
computed
} = Ember;

export default Ember.Component.extend(TableCommon, {
export default Component.extend(TableCommon, {
query: '',

// No need for `enableSync` here
Expand Down
3 changes: 2 additions & 1 deletion tests/dummy/app/components/cookbook/custom-row-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ import Ember from 'ember';
import TableCommon from '../../mixins/table-common';

const {
Component,
computed
} = Ember;

export default Ember.Component.extend(TableCommon, {
export default Component.extend(TableCommon, {
columns: computed(function() {
return [{
label: 'Avatar',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ import Ember from 'ember';
import TableCommon from '../../mixins/table-common';

const {
Component,
computed
} = Ember;

export default Ember.Component.extend(TableCommon, {
export default Component.extend(TableCommon, {
columns: computed(function() {
return [{
label: 'Avatar',
Expand Down
3 changes: 2 additions & 1 deletion tests/dummy/app/components/cookbook/paginated-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ import Ember from 'ember';
import TableCommon from '../../mixins/table-common';

const {
Component,
computed
} = Ember;

export default Ember.Component.extend(TableCommon, {
export default Component.extend(TableCommon, {
columns: computed(function() {
return [{
label: 'Avatar',
Expand Down
3 changes: 2 additions & 1 deletion tests/dummy/app/components/cookbook/table-actions-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ import Ember from 'ember';
import TableCommon from '../../mixins/table-common';

const {
Component,
computed
} = Ember;

export default Ember.Component.extend(TableCommon, {
export default Component.extend(TableCommon, {
columns: computed(function() {
return [{
label: 'Avatar',
Expand Down
3 changes: 2 additions & 1 deletion tests/dummy/app/components/responsive-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ import Ember from 'ember';
import TableCommon from '../mixins/table-common';

const {
Component,
computed
} = Ember;

export default Ember.Component.extend(TableCommon, {
export default Component.extend(TableCommon, {
columns: computed(function() {
return [{
width: '40px',
Expand Down
3 changes: 2 additions & 1 deletion tests/dummy/app/components/rows/expandable-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ import Ember from 'ember';
import TableCommon from '../../mixins/table-common';

const {
Component,
computed
} = Ember;

export default Ember.Component.extend(TableCommon, {
export default Component.extend(TableCommon, {
columns: computed(function() {
return [{
label: 'First Name',
Expand Down
3 changes: 2 additions & 1 deletion tests/dummy/app/components/rows/selectable-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ import Ember from 'ember';
import TableCommon from '../../mixins/table-common';

const {
Component,
computed
} = Ember;

export default Ember.Component.extend(TableCommon, {
export default Component.extend(TableCommon, {
hasSelection: computed.notEmpty('table.selectedRows'),

columns: computed(function() {
Expand Down
3 changes: 2 additions & 1 deletion tests/dummy/app/components/scrolling-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ import Ember from 'ember';
import TableCommon from '../mixins/table-common';

const {
Component,
computed
} = Ember;

export default Ember.Component.extend(TableCommon, {
export default Component.extend(TableCommon, {
currentScrollOffset: 0,
scrollTo: 0,
scrollToRow: null,
Expand Down
3 changes: 2 additions & 1 deletion tests/dummy/app/components/simple-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ import Ember from 'ember';
import TableCommon from '../mixins/table-common';

const {
Component,
computed
} = Ember;

export default Ember.Component.extend(TableCommon, {
export default Component.extend(TableCommon, {
columns: computed(function() {
return [{
label: 'Avatar',
Expand Down
5 changes: 3 additions & 2 deletions tests/dummy/app/mixins/table-common.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ import { task } from 'ember-concurrency';
const {
inject,
isEmpty,
computed
computed,
Mixin
} = Ember;

export default Ember.Mixin.create({
export default Mixin.create({
store: inject.service(),

page: 0,
Expand Down
9 changes: 3 additions & 6 deletions tests/dummy/app/models/user.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import DS from 'ember-data';
import Model from 'ember-data/model';
import attr from 'ember-data/attr';

const {
attr
} = DS;

export default DS.Model.extend({
export default Model.extend({
firstName: attr('string'),
lastName: attr('string'),
company: attr('string'),
Expand Down
1 change: 1 addition & 0 deletions tests/dummy/app/router.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Ember from 'ember';
import config from './config/environment';

// eslint-disable-next-line ember-suave/no-direct-property-access
const Router = Ember.Router.extend({
location: config.locationType,
rootURL: config.rootURL
Expand Down
Loading

0 comments on commit 3d47c1c

Please sign in to comment.