From eba604d2424b51fae0accd5d679455ef6cd4d0ce Mon Sep 17 00:00:00 2001 From: DD Liu <liudi@media.mit.edu> Date: Mon, 17 Jul 2017 14:20:32 -0400 Subject: [PATCH] Add eslint config scratch --- .eslintignore | 3 ++- .eslintrc.js | 2 +- src/.eslintrc.js | 7 +++++++ src/components/paper-canvas.jsx | 4 ++-- 4 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 src/.eslintrc.js diff --git a/.eslintignore b/.eslintignore index 0cbd4879..78503ba0 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1,4 @@ node_modules/* dist/* -playground/ \ No newline at end of file +playground/ +webpack.config.js \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js index 36ff570d..e4ef97c3 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,3 +1,3 @@ module.exports = { - extends: ['scratch', 'scratch/node'] + extends: ['scratch', 'scratch/es6', 'scratch/node'] }; diff --git a/src/.eslintrc.js b/src/.eslintrc.js new file mode 100644 index 00000000..964f1b44 --- /dev/null +++ b/src/.eslintrc.js @@ -0,0 +1,7 @@ +module.exports = { + root: true, + extends: ['scratch', 'scratch/es6', 'scratch/react'], + env: { + browser: true + } +}; \ No newline at end of file diff --git a/src/components/paper-canvas.jsx b/src/components/paper-canvas.jsx index 398da80b..e4df4b14 100644 --- a/src/components/paper-canvas.jsx +++ b/src/components/paper-canvas.jsx @@ -10,10 +10,10 @@ class PaperCanvas extends React.Component { componentDidMount () { paper.setup('paper-canvas'); // Create a Paper.js Path to draw a line into it: - var path = new paper.Path(); + const path = new paper.Path(); // Give the stroke a color path.strokeColor = 'black'; - var start = new paper.Point(100, 100); + const start = new paper.Point(100, 100); // Move to start and draw a line from there path.moveTo(start); // Note that the plus operator on Point objects does not work