fix(all): disallow throwing literals (`@typescript-eslint/no-throw-literal`) (#3086)
This commit is contained in:
Родитель
3c6e7ebe76
Коммит
3ede27809c
|
@ -43,7 +43,12 @@
|
|||
{
|
||||
"files": ["**/*.ts"],
|
||||
"extends": ["@malept/eslint-config/src/typescript"],
|
||||
"parserOptions": {
|
||||
"project": ["./tsconfig.base.json"]
|
||||
},
|
||||
"rules": {
|
||||
"no-throw-literal": "off",
|
||||
"@typescript-eslint/no-throw-literal": "error",
|
||||
"@typescript-eslint/no-unused-vars": [
|
||||
"error",
|
||||
{
|
||||
|
|
|
@ -7,7 +7,6 @@ function redConsoleError(msg: string) {
|
|||
process.on('unhandledRejection', (reason: string, promise: Promise<unknown>) => {
|
||||
redConsoleError('\nAn unhandled rejection has occurred inside Forge:');
|
||||
redConsoleError(reason.toString().trim());
|
||||
redConsoleError('\nElectron Forge was terminated. Location:');
|
||||
promise.catch((err: Error) => {
|
||||
if ('stack' in err) {
|
||||
const usefulStack = err.stack;
|
||||
|
|
|
@ -282,15 +282,10 @@ export const listrMake = (
|
|||
arch: targetArch,
|
||||
});
|
||||
} catch (err) {
|
||||
if (err instanceof Error) {
|
||||
throw {
|
||||
message: `An error occured while making for target: ${maker.name}`,
|
||||
stack: `${err.message}\n${err.stack}`,
|
||||
};
|
||||
} else if (err) {
|
||||
if (err) {
|
||||
throw err;
|
||||
} else {
|
||||
throw new Error(`An unknown error occured while making for target: ${maker.name}`);
|
||||
throw new Error(`An unknown error occurred while making for target: ${maker.name}`);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -53,7 +53,7 @@ export default async (dir: string): Promise<string | null> => {
|
|||
return bestGuessDir;
|
||||
}
|
||||
if (lastError) {
|
||||
throw lastError;
|
||||
throw new Error(lastError);
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
|
|
@ -3,25 +3,6 @@ import * as path from 'path';
|
|||
|
||||
import { getPackageInfo } from './utils';
|
||||
|
||||
const BASE_TS_CONFIG = {
|
||||
'//': '⚠️ AUTOGENERATED ⚠️ This file was automatically generated by tools/gen-tsconfigs.ts, do not edit manually.',
|
||||
compilerOptions: {
|
||||
module: 'commonjs',
|
||||
target: 'es2019',
|
||||
outDir: 'dist',
|
||||
lib: ['dom', 'es2019'],
|
||||
sourceMap: true,
|
||||
rootDir: 'src',
|
||||
experimentalDecorators: true,
|
||||
strict: true,
|
||||
esModuleInterop: true,
|
||||
declaration: true,
|
||||
composite: true,
|
||||
declarationMap: true,
|
||||
},
|
||||
exclude: ['node_modules', 'dist', 'test', 'index.ts', 'tmpl'],
|
||||
};
|
||||
|
||||
/**
|
||||
* Filters out non-unique items in an array.
|
||||
*/
|
||||
|
@ -30,6 +11,7 @@ function filterDupes<T>(arr: readonly T[]): T[] {
|
|||
}
|
||||
|
||||
(async () => {
|
||||
const BASE_TS_CONFIG = JSON.parse(await fs.readFile(path.resolve(__dirname, '../tsconfig.base.json'), 'utf-8'));
|
||||
const packages = await getPackageInfo();
|
||||
|
||||
// Do each package in parallel
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es2019",
|
||||
"outDir": "dist",
|
||||
"lib": ["dom", "es2019"],
|
||||
"sourceMap": true,
|
||||
"rootDir": "src",
|
||||
"experimentalDecorators": true,
|
||||
"strict": true,
|
||||
"esModuleInterop": true,
|
||||
"declaration": true,
|
||||
"composite": true,
|
||||
"declarationMap": true
|
||||
},
|
||||
"exclude": ["node_modules", "dist", "test", "index.ts", "tmpl"]
|
||||
}
|
Загрузка…
Ссылка в новой задаче