diff options
author | silverwind <me@silverwind.io> | 2020-03-11 20:34:54 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-11 21:34:54 +0200 |
commit | e03d6277698f4e1e03d9336ba017bae130d4353c (patch) | |
tree | 418c84dd378bc86093f9837de80f92c13fe87f68 /webpack.config.js | |
parent | 984b85c1a72f9f1561447a8492bc3d33a87e3641 (diff) | |
download | gitea-e03d6277698f4e1e03d9336ba017bae130d4353c.tar.gz gitea-e03d6277698f4e1e03d9336ba017bae130d4353c.zip |
Misc JS linting and naming tweaks (#10652)
- lowercase all js filenames except Vue components
- enable new lint rules, mostly focused on shorter code
- autofix new lint violations
- apply misc transformations indexOf -> includes and onevent-> addEventListener
Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
Diffstat (limited to 'webpack.config.js')
-rw-r--r-- | webpack.config.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/webpack.config.js b/webpack.config.js index dd8688406e..4630710609 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -9,11 +9,11 @@ const PostCSSSafeParser = require('postcss-safe-parser'); const SpriteLoaderPlugin = require('svg-sprite-loader/plugin'); const TerserPlugin = require('terser-webpack-plugin'); const VueLoaderPlugin = require('vue-loader/lib/plugin'); -const { statSync } = require('fs'); -const { resolve, parse } = require('path'); -const { SourceMapDevToolPlugin } = require('webpack'); +const {statSync} = require('fs'); +const {resolve, parse} = require('path'); +const {SourceMapDevToolPlugin} = require('webpack'); -const glob = (pattern) => fastGlob.sync(pattern, { cwd: __dirname, absolute: true }); +const glob = (pattern) => fastGlob.sync(pattern, {cwd: __dirname, absolute: true}); const themes = {}; for (const path of glob('web_src/less/themes/*.less')) { @@ -157,7 +157,7 @@ module.exports = { extract: true, spriteFilename: 'img/svg/icons.svg', symbolId: (path) => { - const { name } = parse(path); + const {name} = parse(path); if (/@primer[/\\]octicons/.test(path)) { return `octicon-${name}`; } @@ -194,7 +194,7 @@ module.exports = { }), new CopyPlugin([ // workaround for https://github.com/go-gitea/gitea/issues/10653 - { from: 'node_modules/fomantic-ui/dist/semantic.min.css', to: 'fomantic/semantic.min.css' }, + {from: 'node_modules/fomantic-ui/dist/semantic.min.css', to: 'fomantic/semantic.min.css'}, ]), ], performance: { |