From 94ff6b3e81df8d74e8e970510f38ea578fea2066 Mon Sep 17 00:00:00 2001 From: Steve Faulkner Date: Mon, 26 Oct 2020 16:50:31 -0500 Subject: [PATCH] Prevent JSON.stringify(error) (#298) --- .eslintrc.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.eslintrc.js b/.eslintrc.js index edfdaddac..8695e29f2 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -42,6 +42,13 @@ module.exports = { "no-null/no-null": "error", "@typescript-eslint/no-explicit-any": "error", "prefer-arrow/prefer-arrow-functions": ["error", { allowStandaloneDeclarations: true }], - eqeqeq: "error" + eqeqeq: "error", + "no-restricted-syntax": [ + "error", + { + selector: "CallExpression[callee.object.name='JSON'][callee.property.name='stringify'] Identifier[name=/$err/]", + message: "Do not use JSON.stringify(error). It will print '{}'" + } + ] } };