diff --git a/.eslintrc.yml b/.eslintrc.yml index 9674cba54..33498aa63 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -22,6 +22,7 @@ globals: parserOptions: ecmaVersion: 6 + sourceType: "module" rules: curly: error diff --git a/js/app/App.js b/js/app/App.js index f973bfef8..1ac6305c6 100644 --- a/js/app/App.js +++ b/js/app/App.js @@ -49,10 +49,10 @@ import md from 'angular-markdown-it'; import nganimate from 'angular-animate'; var app = angular.module('Deck', [ - ngsanitize, - uirouter, - angularuiselect, - ngsortable, md, nganimate + ngsanitize, + uirouter, + angularuiselect, + ngsortable, md, nganimate ]); export default app; diff --git a/js/init.js b/js/init.js index 027a01d1a..e0ac154ba 100644 --- a/js/init.js +++ b/js/init.js @@ -13,13 +13,13 @@ import './app/Run.js'; import ListController from 'controller/ListController.js'; -app.controller('ListController', ListController) +app.controller('ListController', ListController); // require all the js files from subdirectories var context = require.context(".", true, /(controller|service|filters|directive)\/(.*)\.js$/); context.keys().forEach(function (key) { - context(key); + context(key); }); diff --git a/js/webpack.config.js b/js/webpack.config.js index 8409a8ab0..84495f207 100644 --- a/js/webpack.config.js +++ b/js/webpack.config.js @@ -3,52 +3,52 @@ const webpack = require('webpack'); const ExtractTextPlugin = require("extract-text-webpack-plugin"); module.exports = { - entry: { - deck: './init.js', - }, - output: { - filename: '[name].js', - path: __dirname + '/build' - }, - resolve: { - modules: [path.resolve(__dirname), 'node_modules'], - }, - module: { - loaders: [ - { - test: /\.js$/, - exclude: /node_modules/, - loader: 'babel-loader', - }, - { - test: /\.css$/, - use: ExtractTextPlugin.extract({ - use: { - loader: 'css-loader', - options: { - minimize: true, - } - }, - }) - } - ] - }, - plugins: [ - new webpack.optimize.UglifyJsPlugin({ - test: /(vendor\.js)+/i, - }), - // we do not uglify deck.js since there are no proper dependency annotations - new webpack.optimize.CommonsChunkPlugin({ - name: 'vendor', - filename: 'vendor.js', - minChunks(module, count) { - var context = module.context; - return context && context.indexOf('node_modules') >= 0; - }, - }), - new ExtractTextPlugin({ - filename: "../../css/vendor.css", - allChunks: true - }), - ] + entry: { + deck: './init.js', + }, + output: { + filename: '[name].js', + path: __dirname + '/build' + }, + resolve: { + modules: [path.resolve(__dirname), 'node_modules'], + }, + module: { + loaders: [ + { + test: /\.js$/, + exclude: /node_modules/, + loader: 'babel-loader', + }, + { + test: /\.css$/, + use: ExtractTextPlugin.extract({ + use: { + loader: 'css-loader', + options: { + minimize: true, + } + }, + }) + } + ] + }, + plugins: [ + new webpack.optimize.UglifyJsPlugin({ + test: /(vendor\.js)+/i, + }), + // we do not uglify deck.js since there are no proper dependency annotations + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + filename: 'vendor.js', + minChunks(module, count) { + var context = module.context; + return context && context.indexOf('node_modules') >= 0; + }, + }), + new ExtractTextPlugin({ + filename: "../../css/vendor.css", + allChunks: true + }), + ] }; diff --git a/run-eslint.sh b/run-eslint.sh index 536a3ebfc..18f757737 100755 --- a/run-eslint.sh +++ b/run-eslint.sh @@ -12,6 +12,7 @@ find -name "*.js" -path '*js/*' -not -path '*js/node_modules*' \ -not -path '*l10n/*' \ -not -path '*js/vendor*' \ -not -path '*js/tests*' \ + -not -path '*js/webpack*' \ -not -path '*js/public*' \ -not -path '*build/*' \ -not -path '*tests/*' \