Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';
import tseslint from 'typescript-eslint';
import { includeIgnoreFile } from '@eslint/compat';

import eslintConfigPrettier from 'eslint-config-prettier';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const gitignorePath = path.resolve(__dirname, '.gitignore');
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
allConfig: js.configs.all,
});

export default tseslint.config(
Expand All @@ -25,11 +25,14 @@ export default tseslint.config(
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-empty-object-type': 'off',
'camelcase': 'off',
camelcase: 'off',
'no-param-reassign': 'off',
'new-cap': 'off',
'quotes': 'off',
'@typescript-eslint/no-unsafe-function-type':'off'
}
}
quotes: 'off',
'@typescript-eslint/no-unsafe-function-type': 'off',
},
},
// Must be last: turns off ESLint formatting rules that conflict with
// Prettier (indent, max-len, …) so Prettier owns formatting.
eslintConfigPrettier,
);
8 changes: 3 additions & 5 deletions lib/network/rpc/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { ArsenalError, allowUnsafeErrComp } from '../../errors';

// eslint-disable-line

/**
* @brief turn all <tt>err</tt> own and prototype attributes into own attributes
*
Expand Down Expand Up @@ -31,7 +29,7 @@ export function flattenError(err: Error) {
}
}
return flattenedErr;
};
}

/**
* @brief recreate a proper Error object from its flattened
Expand All @@ -58,12 +56,12 @@ export function reconstructError(err: Error) {
// This restores the old behavior of errors. This should be removed as soon
// as all dependent codebases have been migrated to `is` accessors (ARSN-176).
reconstructedErr[err.message] = true;
if (allowUnsafeErrComp){
if (allowUnsafeErrComp) {
// @ts-expect-error
reconstructedErr.is = { [err.message]: true };
}
Object.keys(err).forEach(k => {
reconstructedErr[k] = err[k];
});
return reconstructedErr;
};
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"@types/utf8": "^3.0.3",
"@types/xml2js": "^0.4.14",
"eslint": "^9.37.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-react": "^7.37.1",
"globals": "^16.4.0",
"jest": "^29.7.0",
Expand Down
Loading
Loading