Skip to content

Commit

Permalink
[CHORE] Update eslint to v6 (#6373)
Browse files Browse the repository at this point in the history
address some comments

Remove autofix

remove memory option tweaking

link to issue tracking new rules
  • Loading branch information
Gaurav0 authored and runspired committed Sep 11, 2019
1 parent 63ef2ed commit bc2a074
Show file tree
Hide file tree
Showing 13 changed files with 136 additions and 103 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ node_modules
# misc
/coverage/
!.*
/.yarn/

# ember-try
.node_modules.ember-try
Expand Down
11 changes: 7 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ module.exports = {
'no-irregular-whitespace': 'error',
'no-undef': 'error',
'no-eq-null': 'error',
'no-console': 'error', // no longer recommended in eslint v6, this restores it

// probably want to fix these new rules later in separate PR
// Tracked in issue https://github.com/emberjs/data/issues/6405
'no-prototype-builtins': 'off',
'require-atomic-updates': 'off',
},
globals: {
heimdall: true,
Expand Down Expand Up @@ -74,10 +80,7 @@ module.exports = {
es6: true,
},
plugins: ['node'],
// eslint-disable-next-line node/no-unpublished-require
rules: Object.assign({}, require('eslint-plugin-node').configs.recommended.rules, {
// add your custom rules and overrides for node files here
}),
extends: 'plugin:node/recommended',
},

// node tests
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ node_modules
.env*
.pnp*
.sass-cache
/.eslintcache
/onnect.lock
coverage/*
libpeerconnection.log
Expand Down
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,14 @@
"@types/qunit": "^2.5.3",
"@types/rsvp": "^4.0.3",
"babel-eslint": "^10.0.3",
"babel-plugin-debug-macros": "^0.3.3",
"babel-plugin-feature-flags": "^0.3.1",
"babel-plugin-filter-imports": "^3.0.0",
"babel6-plugin-strip-class-callcheck": "^6.0.0",
"broccoli-asset-rev": "^3.0.0",
"broccoli-babel-transpiler": "^7.2.0",
"broccoli-concat": "^3.7.3",
"broccoli-file-creator": "^2.1.1",
"broccoli-stew": "^3.0.0",
"broccoli-string-replace": "^0.1.2",
"broccoli-test-helper": "^2.0.0",
Expand Down Expand Up @@ -89,10 +94,10 @@
"ember-source": "^3.12.0",
"ember-source-channel-url": "^2.0.1",
"ember-try": "^1.2.1",
"eslint": "^5.15.1",
"eslint": "^6.2.2",
"eslint-config-prettier": "^6.3.0",
"eslint-plugin-mocha": "^6.1.0",
"eslint-plugin-node": "^8.0.0",
"eslint-plugin-node": "^9.2.0",
"eslint-plugin-prettier": "^3.1.0",
"eslint-plugin-qunit": "^4.0.0",
"execa": "^1.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/-build-infra/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"test:node": "mocha"
},
"dependencies": {
"@babel/plugin-transform-block-scoping": "^7.5.5",
"@ember-data/canary-features": "3.14.0-alpha.2",
"babel-plugin-debug-macros": "^0.3.3",
"babel-plugin-feature-flags": "^0.3.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/-ember-data/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"@types/ember-qunit": "^3.4.6",
"@types/ember-test-helpers": "~1.0.5",
"@types/ember-testing-helpers": "~0.0.3",
"@types/ember__debug": "^3.0.3",
"@types/ember__debug": "3.0.4",
"@types/ember__test-helpers": "~0.7.8",
"@types/qunit": "^2.5.3",
"@types/rsvp": "^4.0.3",
Expand Down
1 change: 0 additions & 1 deletion packages/-ember-data/tests/helpers/deep-copy.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* global WeakMap */
export default function deepCopy(obj) {
return _deepCopy(obj, new WeakMap());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
import { reject, resolve, defer, Promise } from 'rsvp';
import { reject, resolve, defer } from 'rsvp';
import { run } from '@ember/runloop';
import { get } from '@ember/object';
import testInDebug from 'dummy/tests/helpers/test-in-debug';
Expand Down Expand Up @@ -195,12 +195,10 @@ module('integration/adapter/find-all - Finding All Records of a Type', function(
let persons = store.peekAll('person');
assert.equal(persons.get('length'), 1);

let promise = new Promise(async resolve => {
let persons = await store.findAll('person');

let promise = store.findAll('person').then(persons => {
assert.equal(persons.get('isUpdating'), false);
assert.equal(persons.get('length'), 2);
resolve();
return persons;
});

assert.equal(persons.get('isUpdating'), true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,6 @@ module('integration/deletedRecord - Deleting Records', function(hooks) {
});

test('records can be deleted during record array enumeration', function(assert) {
var adam, dave;

let store = this.owner.lookup('service:store');
let adapter = store.adapterFor('application');

Expand All @@ -166,8 +164,8 @@ module('integration/deletedRecord - Deleting Records', function(hooks) {
},
],
});
adam = store.peekRecord('person', 1);
dave = store.peekRecord('person', 2);
let adam = store.peekRecord('person', 1);
let dave = store.peekRecord('person', 2);
});
var all = store.peekAll('person');

Expand Down
25 changes: 11 additions & 14 deletions packages/-ember-data/tests/integration/records/unload-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ module('integration/unload - Unloading Records', function(hooks) {
test('can unload all records for a given type', function(assert) {
assert.expect(10);

let adam, bob, dudu, car;
let car;
run(function() {
store.push({
data: [
Expand All @@ -214,8 +214,8 @@ module('integration/unload - Unloading Records', function(hooks) {
},
],
});
adam = store.peekRecord('person', 1);
bob = store.peekRecord('person', 2);
let adam = store.peekRecord('person', 1);
let bob = store.peekRecord('person', 2);

car = store.push({
data: {
Expand All @@ -232,7 +232,7 @@ module('integration/unload - Unloading Records', function(hooks) {
},
},
});
dudu = bob = store.peekRecord('car', 1);
bob = store.peekRecord('car', 1);
});

assert.equal(store.peekAll('person').get('length'), 2, 'two person records loaded');
Expand Down Expand Up @@ -285,7 +285,6 @@ module('integration/unload - Unloading Records', function(hooks) {
test('can unload all records', function(assert) {
assert.expect(8);

let adam, bob, dudu;
run(function() {
store.push({
data: [
Expand All @@ -305,8 +304,8 @@ module('integration/unload - Unloading Records', function(hooks) {
},
],
});
adam = store.peekRecord('person', 1);
bob = store.peekRecord('person', 2);
let adam = store.peekRecord('person', 1);
let bob = store.peekRecord('person', 2);

store.push({
data: {
Expand All @@ -323,7 +322,7 @@ module('integration/unload - Unloading Records', function(hooks) {
},
},
});
dudu = bob = store.peekRecord('car', 1);
bob = store.peekRecord('car', 1);
});

assert.equal(store.peekAll('person').get('length'), 2, 'two person records loaded');
Expand All @@ -344,7 +343,6 @@ module('integration/unload - Unloading Records', function(hooks) {
test('removes findAllCache after unloading all records', function(assert) {
assert.expect(4);

let adam, bob;
run(function() {
store.push({
data: [
Expand All @@ -364,8 +362,8 @@ module('integration/unload - Unloading Records', function(hooks) {
},
],
});
adam = store.peekRecord('person', 1);
bob = store.peekRecord('person', 2);
let adam = store.peekRecord('person', 1);
let bob = store.peekRecord('person', 2);
});

assert.equal(store.peekAll('person').get('length'), 2, 'two person records loaded');
Expand All @@ -381,7 +379,6 @@ module('integration/unload - Unloading Records', function(hooks) {
});

test('unloading all records also updates record array from peekAll()', function(assert) {
let adam, bob;
run(function() {
store.push({
data: [
Expand All @@ -401,8 +398,8 @@ module('integration/unload - Unloading Records', function(hooks) {
},
],
});
adam = store.peekRecord('person', 1);
bob = store.peekRecord('person', 2);
let adam = store.peekRecord('person', 1);
let bob = store.peekRecord('person', 2);
});
let all = store.peekAll('person');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2575,7 +2575,7 @@ module('integration/relationships/has_many - Has-Many Relationships', function(h

let store = this.owner.lookup('service:store');

let chapter, page, page2;
let chapter, page2;
let observe = false;

run(() => {
Expand Down Expand Up @@ -2609,7 +2609,7 @@ module('integration/relationships/has_many - Has-Many Relationships', function(h
},
],
});
page = store.peekRecord('page', 1);
let page = store.peekRecord('page', 1);
page2 = store.peekRecord('page', 2);
chapter = store.peekRecord('chapter', 1);

Expand Down Expand Up @@ -2639,7 +2639,7 @@ module('integration/relationships/has_many - Has-Many Relationships', function(h

let store = this.owner.lookup('service:store');

let chapter, page, page2;
let chapter, page2;
let observe = false;

run(() => {
Expand Down Expand Up @@ -2673,7 +2673,7 @@ module('integration/relationships/has_many - Has-Many Relationships', function(h
},
],
});
page = store.peekRecord('page', 1);
let page = store.peekRecord('page', 1);
page2 = store.peekRecord('page', 2);
chapter = store.peekRecord('chapter', 1);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ module('integration/relationships/many_to_many_test - ManyToMany relationships',

let store = this.owner.lookup('service:store');

let account, ada, byron;
let account;

run(() => {
account = store.push({
Expand All @@ -585,7 +585,7 @@ module('integration/relationships/many_to_many_test - ManyToMany relationships',
},
},
});
ada = store.push({
let ada = store.push({
data: {
id: '1',
type: 'user',
Expand All @@ -604,7 +604,7 @@ module('integration/relationships/many_to_many_test - ManyToMany relationships',
},
},
});
byron = store.push({
let byron = store.push({
data: {
id: '2',
type: 'user',
Expand Down
Loading

0 comments on commit bc2a074

Please sign in to comment.