diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2019-09-25 09:55:33 +0200 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2019-10-01 16:39:37 +0200 |
commit | 7fb651235128dcbca8a6683b5cdafdf835f46300 (patch) | |
tree | 28f6f36bb0b5596981dc99d46b68fcc7b62e282f /webpack.common.js | |
parent | f9870eec2cefef95aa563cbbbe78f2dc9dd5e128 (diff) | |
download | nextcloud-server-7fb651235128dcbca8a6683b5cdafdf835f46300.tar.gz nextcloud-server-7fb651235128dcbca8a6683b5cdafdf835f46300.zip |
Use eslint
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'webpack.common.js')
-rw-r--r-- | webpack.common.js | 143 |
1 files changed, 78 insertions, 65 deletions
diff --git a/webpack.common.js b/webpack.common.js index 695dcc9c226..2dc69b201a4 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -1,20 +1,21 @@ -const path = require('path'); -const merge = require('webpack-merge'); -const { VueLoaderPlugin } = require('vue-loader'); +/* eslint-disable camelcase */ +const path = require('path') +const merge = require('webpack-merge') +const { VueLoaderPlugin } = require('vue-loader') -const core = require('./core/webpack'); -const accessibility = require('./apps/accessibility/webpack'); +const core = require('./core/webpack') -const comments = require('./apps/comments/webpack'); -const files_sharing = require('./apps/files_sharing/webpack'); -const files_trashbin = require('./apps/files_trashbin/webpack'); -const files_versions = require('./apps/files_versions/webpack'); -const oauth2 = require('./apps/oauth2/webpack'); -const systemtags = require('./apps/systemtags/webpack'); -const settings = require('./apps/settings/webpack'); -const twofactor_backupscodes = require('./apps/twofactor_backupcodes/webpack'); -const updatenotifications = require('./apps/updatenotification/webpack'); -const workflowengine = require('./apps/workflowengine/webpack'); +const accessibility = require('./apps/accessibility/webpack') +const comments = require('./apps/comments/webpack') +const files_sharing = require('./apps/files_sharing/webpack') +const files_trashbin = require('./apps/files_trashbin/webpack') +const files_versions = require('./apps/files_versions/webpack') +const oauth2 = require('./apps/oauth2/webpack') +const settings = require('./apps/settings/webpack') +const systemtags = require('./apps/systemtags/webpack') +const twofactor_backupscodes = require('./apps/twofactor_backupcodes/webpack') +const updatenotifications = require('./apps/updatenotification/webpack') +const workflowengine = require('./apps/workflowengine/webpack') module.exports = [] .concat( @@ -31,55 +32,67 @@ module.exports = [] updatenotifications, workflowengine ) - .map(config => - merge.smart({ - module: { - rules: [ - { - test: /\.css$/, - use: ['style-loader', 'css-loader'] - }, - { - test: /\.scss$/, - use: ['style-loader', 'css-loader', 'sass-loader'] - }, - { - test: /\.js$/, - loader: 'babel-loader', - exclude: /node_modules/ - }, - { - test: /\.vue$/, - loader: 'vue-loader' - }, - { - test: /\.(png|jpg|gif)$/, - loader: 'url-loader', - options: { - name: '[name].[ext]?[hash]', - limit: 8192 - } - }, - { - test: /\.handlebars/, - loader: "handlebars-loader", - query: { - extensions: '.handlebars' - } + .map(config => merge.smart({ + module: { + rules: [ + { + test: /\.css$/, + use: ['vue-style-loader', 'css-loader'] + }, + { + test: /\.scss$/, + use: ['vue-style-loader', 'css-loader', 'sass-loader'] + }, + { + test: /\.(js|vue)$/, + loader: 'eslint-loader', + // no checks against vendors, modules or handlebar compiled files + exclude: /node_modules|vendor|templates\.js/, + enforce: 'pre', + options: { + // we cannot simply use the eslint binary as we + // don't want to parse all the js files so let's + // use it from within webpack and only check + // against our compiled files + fix: process.env.ESLINT_FIX === 'true' } - ] - }, - plugins: [ - new VueLoaderPlugin() - ], - resolve: { - alias: { - OC: path.resolve(__dirname, './core/src/OC'), - OCA: path.resolve(__dirname, './core/src/OCA'), - // make sure to use the handlebar runtime when importing - handlebars: 'handlebars/runtime' }, - extensions: ['*', '.js', '.vue', '.json'] - } - }, config) - ); + { + test: /\.vue$/, + loader: 'vue-loader', + exclude: /node_modules/ + }, + { + test: /\.js$/, + loader: 'babel-loader', + exclude: /node_modules/ + }, + { + test: /\.(png|jpg|gif)$/, + loader: 'url-loader', + options: { + name: '[name].[ext]?[hash]', + limit: 8192 + } + }, + { + test: /\.handlebars/, + loader: 'handlebars-loader', + query: { + extensions: '.handlebars' + } + } + + ] + }, + plugins: [new VueLoaderPlugin()], + resolve: { + alias: { + OC: path.resolve(__dirname, './core/src/OC'), + OCA: path.resolve(__dirname, './core/src/OCA'), + // make sure to use the handlebar runtime when importing + handlebars: 'handlebars/runtime' + }, + extensions: ['*', '.js', '.vue'] + } + }, config)) |