Skip to content

Commit

Permalink
Revert "Fix: Replace Infinity with Number.MAX_SAFE_INTEGER (fixes #13427
Browse files Browse the repository at this point in the history
) (#13435)"

This reverts commit de77c11.
  • Loading branch information
aladdin-add committed Jun 30, 2020
1 parent 5c4c3fd commit 4e679b1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 22 deletions.
7 changes: 1 addition & 6 deletions lib/cli-engine/config-array-factory.js
Expand Up @@ -722,12 +722,7 @@ class ConfigArrayFactory {
*
* Refer https://github.com/eslint/eslint/issues/12592
*/
const clonedRulesConfig = rules && JSON.parse(
JSON.stringify(
rules,
(key, value) => (value === Infinity ? Number.MAX_SAFE_INTEGER : value)
)
);
const clonedRulesConfig = rules && JSON.parse(JSON.stringify((rules)));

// Flatten `extends`.
for (const extendName of extendList.filter(Boolean)) {
Expand Down

This file was deleted.

12 changes: 2 additions & 10 deletions tests/lib/cli.js
Expand Up @@ -1172,7 +1172,9 @@ describe("cli", () => {

assert.strictEqual(exit, 0);
});
});

describe("config file and input file", () => {
it("should exit with 1 as camelcase has wrong property type", async () => {
const configPath = getFixturePath("config-file", "cloned-config", "eslintConfigFail.js");
const filePath = getFixturePath("config-file", "cloned-config", "index.js");
Expand All @@ -1185,16 +1187,6 @@ describe("cli", () => {
}

});

it("should not cause an error when a rule configuration has `Infinity`", async () => {
const configPath = getFixturePath("config-file", "cloned-config", "configWithInfinity.js");
const filePath = getFixturePath("config-file", "cloned-config", "index.js");
const args = `--config ${configPath} ${filePath}`;

const exit = await cli.execute(args);

assert.strictEqual(exit, 0);
});
});

describe("inline config and input file", () => {
Expand Down

0 comments on commit 4e679b1

Please sign in to comment.