Skip to content
Permalink
Browse files

style(generic): disable some eslint rules that don't make sense in a …

…CLI tool
  • Loading branch information
MarshallOfSound committed Dec 4, 2016
1 parent 3e11610 commit f1f06acf369de4737919239864a6d49fe1b697e3
Showing with 16 additions and 12 deletions.
  1. +5 −2 .eslintrc
  2. +3 −3 src/electron-forge-make.js
  3. +7 −6 src/electron-forge-package.js
  4. +1 −1 src/makers/win32/squirrel.js
@@ -3,8 +3,11 @@
"rules": {
"consistent-return": 0,
"global-require": 0,
"no-underscore-dangle": 0,
"linebreak-style": 0
"import/no-dynamic-require": 0,
"linebreak-style": 0,
"max-len": [2, 160],
"no-console": 0,
"no-underscore-dangle": 0
},
"parser": "babel-eslint"
}
@@ -58,17 +58,17 @@ const main = async () => {
const makeSpinner = ora.ora(`Making for target: ${target.cyan} - On platform: ${process.platform.cyan}`).start();
let maker;
try {
maker = require(`./makers/${process.platform}/${target}.js`); //eslint-disable-line
maker = require(`./makers/${process.platform}/${target}.js`);
} catch (err1) {
try {
maker = require(`./makers/generic/${target}.js`); //eslint-disable-line
maker = require(`./makers/generic/${target}.js`);
} catch (err2) {
makeSpinner.fail();
throw new Error(`Could not find a build target with the name: ${target} for the platform: ${process.platform}`);
}
}
try {
await (maker.default || maker)(packageDir, packageJSON.productName || packageJSON.name, forgeConfig); // eslint-disable-line
await (maker.default || maker)(packageDir, packageJSON.productName || packageJSON.name, forgeConfig);
} catch (err) {
makeSpinner.fail();
if (err) throw err;
@@ -55,7 +55,7 @@ const main = async () => {
afterCopy: [async (buildPath, electronVersion, pPlatform, pArch, done) => {
await pify(rimraf)(path.resolve(buildPath, 'node_modules/electron-compile/test'));
done();
}].concat(forgeConfig.electronPackagerConfig.afterCopy ? forgeConfig.electronPackagerConfig.afterCopy.map(item => require(item)) : []), // eslint-disable-line
}].concat(forgeConfig.electronPackagerConfig.afterCopy ? forgeConfig.electronPackagerConfig.afterCopy.map(item => require(item)) : []),
dir,
arch,
platform,
@@ -64,17 +64,18 @@ const main = async () => {
});
const userDefinedAsarPrefs = packageOpts.asar;
packageOpts.asar = false;
const log = console.error; // eslint-disable-line
console.error = () => {}; // eslint-disable-line

// Prevent electron-packager spitting logs out
const log = console.error;
console.error = () => {};
const packageDirs = await pify(packager)(packageOpts);
console.error = log; // eslint-disable-line
console.error = log;

packagerSpinner.succeed();

const compileSpinner = ora.ora('Compiling Application').start();

const compileCLI = require(path.resolve(dir, 'node_modules/electron-compile/lib/cli.js')); // eslint-disable-line
const { runAsarArchive } = require(path.resolve(dir, 'node_modules/electron-compile/lib/packager-cli.js')); // eslint-disable-line
const compileCLI = require(path.resolve(dir, 'node_modules/electron-compile/lib/cli.js'));

const env = process.env.NODE_ENV;
process.env.NODE_ENV = 'production';
@@ -5,7 +5,7 @@ import path from 'path';
import pify from 'pify';
import rimraf from 'rimraf';

export default async (dir, appName, forgeConfig) => { // eslint-disable-line
export default async (dir, appName, forgeConfig) => {
const outPath = path.resolve(dir, '../make/squirrel.windows');
if (await fs.exists(outPath)) {
await pify(rimraf)(outPath);

0 comments on commit f1f06ac

Please sign in to comment.
You can’t perform that action at this time.