diff --git a/src/clean.ts b/src/clean.ts index 2205dea7..11a165f0 100644 --- a/src/clean.ts +++ b/src/clean.ts @@ -1,5 +1,12 @@ // Prettier offers a clean way to define ignored properties. -const ignoredProperties = new Set(['loc', 'range', 'comments']); +const ignoredProperties = new Set([ + 'loc', + 'range', + 'comments', + // this function is defined at constructor time so it won't pass AST + // comparisons. + 'cleanModifierInvocationArguments' +]); // eslint-disable-next-line @typescript-eslint/no-empty-function function clean(/* ast, newObj, parent */): void {} clean.ignoredProperties = ignoredProperties; diff --git a/tests/config/run-format-test.js b/tests/config/run-format-test.js index 0bfdc37b..3839afc3 100644 --- a/tests/config/run-format-test.js +++ b/tests/config/run-format-test.js @@ -358,9 +358,7 @@ async function runTest({ if (isAstUnstableTest) { expect(formattedAst).not.toEqual(originalAst); } else { - expect(JSON.parse(JSON.stringify(formattedAst))).toEqual( - JSON.parse(JSON.stringify(originalAst)), - ); + expect(formattedAst).toEqual(originalAst); } }