Skip to content

Commit 338170a

Browse files
committed
Fixing linter warnings
1 parent 57e6239 commit 338170a

File tree

37 files changed

+102
-93
lines changed

37 files changed

+102
-93
lines changed

.eslintrc.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
module.exports = {
2-
extends: [
3-
'plugin:@shopify/esnext',
4-
'plugin:@shopify/jest',
5-
'plugin:@shopify/prettier',
6-
],
2+
extends: ['plugin:@shopify/esnext', 'plugin:@shopify/jest', 'plugin:@shopify/prettier'],
73
env: {
84
browser: true,
5+
node: true,
96
},
107
rules: {
118
'import/no-unresolved': 'off',
129
'import/no-extraneous-dependencies': 'off',
1310
'class-methods-use-this': 'off',
1411
'line-comment-position': 0,
1512
'lines-around-comment': 'off',
13+
'jest/valid-title': 'off',
1614
},
1715
};

.vscode/settings.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
"lib": true
1111
},
1212
"editor.formatOnSave": true,
13-
"prettier.eslintIntegration": true,
13+
"editor.codeActionsOnSave": {
14+
"source.fixAll.eslint": true
15+
},
1416
"javascript.validate.enable": false,
1517
"eslint.validate": ["javascript"]
1618
}

scripts/build.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const webpack = require('webpack');
2+
23
const {isProd, useAnalyser} = require('./build/config');
34
const {createConfig: createDevelopmentConfig} = require('./build/development');
45
const {createConfig: createProductionConfig} = require('./build/production');

scripts/build/config.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* eslint-disable no-process-env */
2-
31
const args = process.argv.filter((value, index) => index >= 2);
42
const useAnalyser = args.find((value) => value === '--analyser');
53
const isProd = args.find((value) => value === '--production');
@@ -15,5 +13,3 @@ module.exports = {
1513
resolveModules,
1614
useAnalyser,
1715
};
18-
19-
/* eslint-enable no-process-env */

scripts/build/development.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
2+
23
const {targetPath, resolveModules} = require('./config');
34

45
function createConfig({analyser}) {

scripts/build/production.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
2+
23
const {targetPath, resolveModules} = require('./config');
34
const {bundles} = require('./bundles');
45

scripts/test/environment.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ window.cancelAnimationFrame = (id) => {
88
return clearTimeout(id);
99
};
1010

11-
Event.prototype.stopPropagation = (function(_super) {
12-
return function(...args) {
11+
Event.prototype.stopPropagation = (function (_super) {
12+
return function (...args) {
1313
const returnValue = _super.call(this, ...args);
1414
this.stoppedPropagation = true;
1515
return returnValue;
1616
};
1717
})(Event.prototype.stopPropagation);
1818

19-
Event.prototype.stopImmediatePropagation = (function(_super) {
20-
return function(...args) {
19+
Event.prototype.stopImmediatePropagation = (function (_super) {
20+
return function (...args) {
2121
const returnValue = _super.call(this, ...args);
2222
this.stoppedPropagation = true;
2323
return returnValue;

scripts/test/helpers/event.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export function triggerEvent(element, type, data = {}) {
55
event.initEvent(type, true, true);
66

77
for (const key in data) {
8-
if (data.hasOwnProperty(key)) {
8+
if (Object.prototype.hasOwnProperty.call(data, key)) {
99
Object.defineProperty(event, key, {
1010
value: data[key],
1111
});

scripts/test/helpers/plugin.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ export class TestPlugin extends AbstractPlugin {
44
constructor(draggable) {
55
super(draggable);
66

7-
this.attachFunction = jest.fn();
8-
this.detachFunction = jest.fn();
7+
jest.spyOn(this, 'attachFunction').mockImplementation();
8+
jest.spyOn(this, 'detachFunction').mockImplementation();
99
}
1010

1111
attach() {
@@ -15,4 +15,9 @@ export class TestPlugin extends AbstractPlugin {
1515
detach() {
1616
this.detachFunction();
1717
}
18+
19+
/* eslint-disable no-empty-function */
20+
attachFunction() {}
21+
detachFunction() {}
22+
/* eslint-enable no-empty-function */
1823
}

scripts/test/matchers/event.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function toHaveBeenCalledWithEvent(jestFunction, expectedEventConstructor) {
66
let pass;
77
let message;
88

9-
// eslint-disable-next-line babel/no-invalid-this
9+
// eslint-disable-next-line @babel/no-invalid-this
1010
pass = this.isNot && mockCalls.length === 0;
1111
if (pass) {
1212
message = () => `Expected ${expectedEventConstructor.type} event ${expectation(!pass)} triggered`;

0 commit comments

Comments
 (0)