From c5cf286a6ad1b185da5e4622e2cc1b0a2268c32c Mon Sep 17 00:00:00 2001 From: tokita Date: Tue, 6 Feb 2018 17:58:09 +0900 Subject: [PATCH] fix --- package.json | 7 ++++++- src/js/app.js | 4 ---- src/js/example.js | 4 ++++ src/js/test/{app.test.js => example.test.js} | 2 +- webpack.config.js | 20 ++++++++------------ 5 files changed, 19 insertions(+), 18 deletions(-) create mode 100644 src/js/example.js rename src/js/test/{app.test.js => example.test.js} (70%) diff --git a/package.json b/package.json index 18770e0..e1d0cba 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,12 @@ "presets": "env" }, "eslintConfig": { - "extends": "airbnb-base" + "extends": "airbnb-base", + "globals": { + "window": true, + "document": true, + "alert": true + } }, "devDependencies": { "babel-core": "^6.26.0", diff --git a/src/js/app.js b/src/js/app.js index 9a6a659..e69de29 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -1,4 +0,0 @@ -// testのサンプルです。 -const sum = (a, b) => a + b; - -export default sum; diff --git a/src/js/example.js b/src/js/example.js new file mode 100644 index 0000000..9a6a659 --- /dev/null +++ b/src/js/example.js @@ -0,0 +1,4 @@ +// testのサンプルです。 +const sum = (a, b) => a + b; + +export default sum; diff --git a/src/js/test/app.test.js b/src/js/test/example.test.js similarity index 70% rename from src/js/test/app.test.js rename to src/js/test/example.test.js index e5b076e..af4d593 100644 --- a/src/js/test/app.test.js +++ b/src/js/test/example.test.js @@ -1,4 +1,4 @@ -import sum from '../app'; +import sum from '../example'; it('adds 1 + 2 to equal 3', () => { expect(sum(1, 2)).toBe(3); diff --git a/webpack.config.js b/webpack.config.js index c56d6f2..ba217c1 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -39,18 +39,14 @@ module.exports = [ filename: 'style.css' }, module: { - rules: [ - { - test: /\.scss$/, - use: ExtractTextPlugin.extract({ - fallback: 'style-loader', - use: ['css-loader', 'sass-loader'] - }) - } - ] + rules: [{ + test: /\.scss$/, + use: ExtractTextPlugin.extract({ + fallback: 'style-loader', + use: ['css-loader', 'sass-loader'] + }) + }] }, - plugins: [ - new ExtractTextPlugin('style.css') - ] + plugins: [ new ExtractTextPlugin('style.css') ] } ];