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

Code before:
                `,
                "test.md": unIndent`
                    \`\`\`js
                    console.log("hello")
                    \`\`\`
                    \`\`\`html
                    <div>Hello</div>
                    <script lang="js">
                        console.log("hello")
                    </script>
                    <script lang="ts">
                        console.log("hello")
                    </script>
                    \`\`\`
                `
            };

            // unique directory for each test to avoid quirky disk-cleanup errors
            let id;

            beforeEach(() => (id = Date.now().toString()));

            /*
             * `fs.rmdir(path, { recursive: true })` is deprecated and will be removed.
             * Use `fs.rm(path, { recursive: true })` instead.
             * When supporting Node.js 14+, the compatibility condition can be removed for `fs.rmdir`.
             */
            if (typeof fsp.rm === "function") {
                afterEach(async () => fsp.rm(root, { recursive: true, force: true }));
            } else {
                afterEach(async () => fsp.rmdir(root, { recursive: true, force: true }));
            }

            it("should lint only JavaScript blocks.", async () => {
                const teardown = createCustomTeardown({
                    cwd: path.join(root, id),
                    files: {
                        ...commonFiles,
                        "eslint.config.js": `module.exports = [
                            {
                                plugins: {
                                    markdown: require("eslint-plugin-markdown"),
                                    html: require("eslint-plugin-html")
                                }
                            },
                            {
                                files: ["**/*.js"],
                                rules: { semi: "error" }
                            },
                            {
                                files: ["**/*.md"],

Review comment (refactor):
```suggestion
             * When supporting Node.js 14.14.0+, the compatibility condition can be removed for `fs.rmdir`.
```

According to the [documentation](https://nodejs.org/api/fs.html#fspromisesrmpath-options), we'll need 14.14+ to remove this condition?

> __fsPromises.rm(path[, options]))__
> Added in: v14.14.0

Code after:
                `,
                "test.md": unIndent`
                    \`\`\`js
                    console.log("hello")
                    \`\`\`
                    \`\`\`html
                    <div>Hello</div>
                    <script lang="js">
                        console.log("hello")
                    </script>
                    <script lang="ts">
                        console.log("hello")
                    </script>
                    \`\`\`
                `
            };

            // unique directory for each test to avoid quirky disk-cleanup errors
            let id;

            beforeEach(() => (id = Date.now().toString()));

            /*
             * `fs.rmdir(path, { recursive: true })` is deprecated and will be removed.
             * Use `fs.rm(path, { recursive: true })` instead.
             * When supporting Node.js 14.14.0+, the compatibility condition can be removed for `fs.rmdir`.
             */
            if (typeof fsp.rm === "function") {
                afterEach(async () => fsp.rm(root, { recursive: true, force: true }));
            } else {
                afterEach(async () => fsp.rmdir(root, { recursive: true, force: true }));
            }

            it("should lint only JavaScript blocks.", async () => {
                const teardown = createCustomTeardown({
                    cwd: path.join(root, id),
                    files: {
                        ...commonFiles,
                        "eslint.config.js": `module.exports = [
                            {
                                plugins: {
                                    markdown: require("eslint-plugin-markdown"),
                                    html: require("eslint-plugin-html")
                                }
                            },
                            {
                                files: ["**/*.js"],
                                rules: { semi: "error" }
                            },
                            {
                                files: ["**/*.md"],