Skip to content
This repository has been archived by the owner on Aug 19, 2024. It is now read-only.

Commit

Permalink
Moved from eslint to prettier for linting
Browse files Browse the repository at this point in the history
  • Loading branch information
hanzlamateen committed Mar 14, 2022
1 parent 141a023 commit d7b937b
Show file tree
Hide file tree
Showing 28 changed files with 411 additions and 555 deletions.
12 changes: 0 additions & 12 deletions .editorconfig

This file was deleted.

32 changes: 16 additions & 16 deletions .electron/configs/webpack.config.base.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
* Base webpack config used across other specific configs
*/
import webpack from 'webpack'

import webpack from 'webpack';
import webpackPaths from './webpack.paths';
import { dependencies as externals } from '../../release/app/package.json';
import { dependencies as externals } from '../../release/app/package.json'
import webpackPaths from './webpack.paths'

const configuration: webpack.Configuration = {
externals: [...Object.keys(externals || {})],
Expand All @@ -20,34 +20,34 @@ const configuration: webpack.Configuration = {
loader: 'ts-loader',
options: {
// Remove this line to enable type checking in webpack builds
transpileOnly: true,
},
},
},
],
transpileOnly: true
}
}
}
]
},

output: {
path: webpackPaths.srcPath,
// https://github.com/webpack/webpack/issues/1114
library: {
type: 'commonjs2',
},
type: 'commonjs2'
}
},

/**
* Determine the array of extensions that should be used to resolve modules.
*/
resolve: {
extensions: ['.js', '.jsx', '.json', '.ts', '.tsx'],
modules: [webpackPaths.srcPath, 'node_modules'],
modules: [webpackPaths.srcPath, 'node_modules']
},

plugins: [
new webpack.EnvironmentPlugin({
NODE_ENV: 'production',
}),
],
};
NODE_ENV: 'production'
})
]
}

export default configuration;
export default configuration
2 changes: 1 addition & 1 deletion .electron/configs/webpack.config.eslint.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/* eslint import/no-unresolved: off, import/no-self-import: off */

module.exports = require('./webpack.config.renderer.dev').default;
module.exports = require('./webpack.config.renderer.dev').default
50 changes: 25 additions & 25 deletions .electron/configs/webpack.config.main.prod.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
/**
* Webpack config for production electron main process
*/
import path from 'path'
import TerserPlugin from 'terser-webpack-plugin'
import webpack from 'webpack'
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'
import { merge } from 'webpack-merge'

import path from 'path';
import webpack from 'webpack';
import { merge } from 'webpack-merge';
import TerserPlugin from 'terser-webpack-plugin';
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
import baseConfig from './webpack.config.base';
import webpackPaths from './webpack.paths';
import checkNodeEnv from '../scripts/check-node-env';
import deleteSourceMaps from '../scripts/delete-source-maps';
import checkNodeEnv from '../scripts/check-node-env'
import deleteSourceMaps from '../scripts/delete-source-maps'
import baseConfig from './webpack.config.base'
import webpackPaths from './webpack.paths'

checkNodeEnv('production');
deleteSourceMaps();
checkNodeEnv('production')
deleteSourceMaps()

const devtoolsConfig =
process.env.DEBUG_PROD === 'true'
? {
devtool: 'source-map',
devtool: 'source-map'
}
: {};
: {}

const configuration: webpack.Configuration = {
...devtoolsConfig,
Expand All @@ -31,25 +31,25 @@ const configuration: webpack.Configuration = {

entry: {
main: path.join(webpackPaths.srcMainPath, 'main.ts'),
preload: path.join(webpackPaths.srcMainPath, 'preload.js'),
preload: path.join(webpackPaths.srcMainPath, 'preload.js')
},

output: {
path: webpackPaths.distMainPath,
filename: '[name].js',
filename: '[name].js'
},

optimization: {
minimizer: [
new TerserPlugin({
parallel: true,
}),
],
parallel: true
})
]
},

plugins: [
new BundleAnalyzerPlugin({
analyzerMode: process.env.ANALYZE === 'true' ? 'server' : 'disabled',
analyzerMode: process.env.ANALYZE === 'true' ? 'server' : 'disabled'
}),

/**
Expand All @@ -64,8 +64,8 @@ const configuration: webpack.Configuration = {
new webpack.EnvironmentPlugin({
NODE_ENV: 'production',
DEBUG_PROD: false,
START_MINIMIZED: false,
}),
START_MINIMIZED: false
})
],

/**
Expand All @@ -75,8 +75,8 @@ const configuration: webpack.Configuration = {
*/
node: {
__dirname: false,
__filename: false,
},
};
__filename: false
}
}

export default merge(baseConfig, configuration);
export default merge(baseConfig, configuration)
42 changes: 21 additions & 21 deletions .electron/configs/webpack.config.renderer.dev.dll.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/**
* Builds the DLL for development electron renderer process
*/
import path from 'path'
import webpack from 'webpack'
import { merge } from 'webpack-merge'

import webpack from 'webpack';
import path from 'path';
import { merge } from 'webpack-merge';
import baseConfig from './webpack.config.base';
import webpackPaths from './webpack.paths';
import { dependencies } from '../../package.json';
import checkNodeEnv from '../scripts/check-node-env';
import { dependencies } from '../../package.json'
import checkNodeEnv from '../scripts/check-node-env'
import baseConfig from './webpack.config.base'
import webpackPaths from './webpack.paths'

checkNodeEnv('development');
checkNodeEnv('development')

const dist = webpackPaths.dllPath;
const dist = webpackPaths.dllPath

const configuration: webpack.Configuration = {
context: webpackPaths.rootPath,
Expand All @@ -31,22 +31,22 @@ const configuration: webpack.Configuration = {
module: require('./webpack.config.renderer.dev').default.module,

entry: {
renderer: Object.keys(dependencies || {}),
renderer: Object.keys(dependencies || {})
},

output: {
path: dist,
filename: '[name].dev.dll.js',
library: {
name: 'renderer',
type: 'var',
},
type: 'var'
}
},

plugins: [
new webpack.DllPlugin({
path: path.join(dist, '[name].json'),
name: '[name]',
name: '[name]'
}),

/**
Expand All @@ -59,19 +59,19 @@ const configuration: webpack.Configuration = {
* development checks
*/
new webpack.EnvironmentPlugin({
NODE_ENV: 'development',
NODE_ENV: 'development'
}),

new webpack.LoaderOptionsPlugin({
debug: true,
options: {
context: webpackPaths.srcPath,
output: {
path: webpackPaths.dllPath,
},
},
}),
],
};
path: webpackPaths.dllPath
}
}
})
]
}

export default merge(baseConfig, configuration);
export default merge(baseConfig, configuration)
Loading

0 comments on commit d7b937b

Please sign in to comment.