From ebc28d76658f1f3e4e8d56e70a25752b5d4a6686 Mon Sep 17 00:00:00 2001 From: Brandon Mills Date: Thu, 23 Apr 2020 00:20:53 -0400 Subject: [PATCH] Fix: Remove default .js from --ext CLI option (#13176) PR #12677, `Breaking: lint overrides files`, removed the default `.js` value from the default CLIEngine options. However, it did not remove the same default value from the `--ext` option parsed by Optionator. Because of this, when running `eslint .` without the `--ext` option, Optionator would insert a default `--ext .js` value that would be passed on to the CLIEngine. ESLint only lints `overrides` files if the `--ext` CLI option is not passed, so the default `--ext .js` option prevented ESLint from ever reaching the `overrides` file path checking flow. --- lib/options.js | 1 - tests/lib/options.js | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/options.js b/lib/options.js index 98dc04b6eb3..1681f1dbd1d 100644 --- a/lib/options.js +++ b/lib/options.js @@ -46,7 +46,6 @@ module.exports = optionator({ { option: "ext", type: "[String]", - default: ".js", description: "Specify JavaScript file extensions" }, { diff --git a/tests/lib/options.js b/tests/lib/options.js index 940804aeeef..c84e46d9afd 100644 --- a/tests/lib/options.js +++ b/tests/lib/options.js @@ -79,11 +79,10 @@ describe("options", () => { assert.strictEqual(currentOptions.ext[1], ".js"); }); - it("should return an array one item when not passed", () => { + it("should not exist when not passed", () => { const currentOptions = options.parse(""); - assert.isArray(currentOptions.ext); - assert.strictEqual(currentOptions.ext[0], ".js"); + assert.notProperty(currentOptions, "ext"); }); });