Skip to content

Commit 6e08a11

Browse files
committed
🎨 [JS] Fix linting
1 parent 5f32399 commit 6e08a11

File tree

13 files changed

+27
-11
lines changed

13 files changed

+27
-11
lines changed

examples/.eslintrc.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
/* eslint-env node */
12
module.exports = {
23
extends: ['plugin:shopify/esnext', 'plugin:shopify/webpack', 'plugin:shopify/prettier'],
34
globals: {},
45
rules: {
56
'shopify/jsx-no-complex-expressions': 'off',
67
'eslint-comments/no-unlimited-disable': 0,
7-
'import/no-default-export': ['error'],
8+
// 'import/no-default-export': ['error'],
89
'lines-around-comment': [
910
'error',
1011
{
@@ -16,11 +17,13 @@ module.exports = {
1617
'no-negated-condition': 'off',
1718
// We are intentionally keeping `TODO` comments until a stable release
1819
'no-warning-comments': 'off',
20+
'import/no-cycle': 'off',
1921
// TODO: Disabling for now, but we will want to re-enable in the future.
2022
'import/no-default-export': 'off',
21-
'import/no-cycle': 'off',
2223
},
2324
env: {
2425
browser: true,
2526
},
27+
// Required, else eslint will look at the parent config
28+
root: true,
2629
};

examples/src/components/Plate/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function calculatePlateScale(value, max, factor) {
1616
const step1 = Math.abs(value) / max;
1717
const step2 = step1 - step1 * factor;
1818

19-
return 1 - step2; // step 3
19+
return 1 - step2;
2020
}
2121

2222
export default class Plate {
@@ -89,6 +89,7 @@ export default class Plate {
8989

9090
_translateEachPlate(x, y) {
9191
for (const plateLevel in this.plates) {
92+
// eslint-disable-next-line no-prototype-builtins
9293
if (this.plates.hasOwnProperty(plateLevel)) {
9394
const translateX = flipSign(x * 2) * translateFactors[plateLevel];
9495
const translateY = flipSign(y * 2) * translateFactors[plateLevel];

examples/src/content/Home/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// eslint-disable-next-line import/no-unresolved
22
import {Draggable} from '@shopify/draggable';
3+
4+
// eslint-disable-next-line shopify/strict-component-boundaries
35
import Plate from '../../components/Plate';
46

57
export default function Home() {

examples/src/content/Sortable/MultipleContainers/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ export default function MultipleContainers() {
2929

3030
// --- Draggable events --- //
3131
sortable.on('drag:start', (evt) => {
32-
currentMediumChildren = sortable.getDraggableElementsForContainer(sortable.containers[1]).length;
32+
currentMediumChildren = sortable.getDraggableElementsForContainer(sortable.containers[1])
33+
.length;
3334
capacityReached = currentMediumChildren === containerTwoCapacity;
3435
lastOverContainer = evt.sourceContainer;
3536
containerTwoParent.classList.toggle(Classes.capacity, capacityReached);

examples/src/scripts/examples-app.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
// eslint-disable-next-line shopify/strict-component-boundaries
12
import Analytics from '../components/Analytics';
3+
// eslint-disable-next-line shopify/strict-component-boundaries
24
import MobileNav from '../components/MobileNav';
35
import Content from '../content';
46

@@ -12,6 +14,7 @@ mobileNav.init();
1214

1315
// Initialize all examples
1416
for (const Example in Content) {
17+
// eslint-disable-next-line no-prototype-builtins
1518
if (Content.hasOwnProperty(Example)) {
1619
Content[Example]();
1720
}

examples/src/scripts/utils/debounce.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export default function debounce(callback, wait) {
22
let timeout = null;
33

4-
return function(...args) {
4+
return function (...args) {
55
const context = this; // eslint-disable-line consistent-this, babel/no-invalid-this
66

77
clearTimeout(timeout);

examples/tools/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import gulp from 'gulp';
2+
23
import tasks from './tasks';
34
import {watch} from './watch';
45

examples/tools/tasks/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {startServer} from '../server';
2+
23
import {scripts} from './scripts';
34
import {styles} from './styles';
45
import {views} from './views';

examples/tools/tasks/scripts.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import webpack from 'webpack';
2+
23
import {webpackConfig} from '../webpack.config';
34

45
export function scripts() {

examples/tools/tasks/styles.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import gulp from 'gulp';
22
import sass from 'gulp-sass';
33
import postcss from 'gulp-postcss';
44
import sourcemaps from 'gulp-sourcemaps';
5+
56
import {server} from '../server';
67

78
export const srcStyles = 'src/styles/';

0 commit comments

Comments
 (0)