Repository: eslint/eslint
File: tests/lib/rule-tester/flat-rule-tester.js (JavaScript)

Code before:
                    filename: "somefile"
                }
            ],
            invalid: []
        });
    });

    it("should allow setting the filename to a file path with extension", () => {
        ruleTester.run("", require("../../fixtures/testers/rule-tester/no-test-filename"), {
            valid: [
                {
                    code: "var foo = 'bar'",
                    filename: "path/to/somefile.js"
                }
            ],
            invalid: []
        });
    });

    it("should allow setting the filename to a file path without extension", () => {
        ruleTester.run("", require("../../fixtures/testers/rule-tester/no-test-filename"), {
            valid: [
                {
                    code: "var foo = 'bar'",
                    filename: "path/to/somefile"
                }
            ],
            invalid: []
        });
    });

    it("should keep allowing non-JavaScript files if the default config does not specify files", () => {
        FlatRuleTester.setDefaultConfig({ rules: {} });
        ruleTester.run("", require("../../fixtures/testers/rule-tester/no-test-filename"), {
            valid: [
                {
                    code: "var foo = 'bar'",
                    filename: "somefile.ts"
                }
            ],
            invalid: []
        });
        FlatRuleTester.resetDefaultConfig();
    });

    it("should pass-through the options to the rule", () => {
        ruleTester.run("no-invalid-args", require("../../fixtures/testers/rule-tester/no-invalid-args"), {
            valid: [
                {
                    code: "var foo = 'bar'",
                    options: [false]

Review comment (suggestion):
```suggestion
                },
                {
                    code: "var foo = 'bar'",
                    filename: "path/to/somefile.ts"
                }
```

It would be good to also check another extension here in addition to `.js`.

Code after:
                    filename: "somefile"
                },
                {
                    code: "var foo = 'bar'",
                    filename: "path/to/somefile"
                }
            ],
            invalid: []
        });
    });

    it("should allow setting the filename to a file path with extension", () => {
        ruleTester.run("", require("../../fixtures/testers/rule-tester/no-test-filename"), {
            valid: [
                {
                    code: "var foo = 'bar'",
                    filename: "path/to/somefile.js"
                },
                {
                    code: "var foo = 'bar'",
                    filename: "src/somefile.ts"
                },
                {
                    code: "var foo = 'bar'",
                    filename: "components/Component.vue"
                }
            ],
            invalid: []
        });
    });

    it("should allow setting the filename to a file path without extension", () => {
        ruleTester.run("", require("../../fixtures/testers/rule-tester/no-test-filename"), {
            valid: [
                {
                    code: "var foo = 'bar'",
                    filename: "path/to/somefile"
                },
                {
                    code: "var foo = 'bar'",
                    filename: "src/somefile"
                }
            ],
            invalid: []
        });
    });

    it("should keep allowing non-JavaScript files if the default config does not specify files", () => {
        FlatRuleTester.setDefaultConfig({ rules: {} });
        ruleTester.run("", require("../../fixtures/testers/rule-tester/no-test-filename"), {
            valid: [