Fix eslint errors

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2018-04-11 13:00:22 +02:00
parent 2cd5606d40
commit 6f254510c1
5 changed files with 56 additions and 54 deletions

View File

@@ -22,6 +22,7 @@ globals:
parserOptions:
ecmaVersion: 6
sourceType: "module"
rules:
curly: error

View File

@@ -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;

View File

@@ -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);
});

View File

@@ -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
}),
]
};

View File

@@ -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/*' \