Repository: eslint/eslint
File: tests/lib/rules/no-unused-vars.js (JavaScript)

Code before:
            code: "export default (a) => {};",
            languageOptions: { ecmaVersion: 6, sourceType: "module" },
            errors: [definedError("a")]
        },
        {
            code: "export default (a, b) => { console.log(a); };",
            languageOptions: { ecmaVersion: 6, sourceType: "module" },
            errors: [definedError("b")]
        },

        // caughtErrors
        {
            code: "try{}catch(err){};",
            options: [{ caughtErrors: "all" }],
            errors: [definedError("err")]
        },
        {
            code: "try{}catch(err){};",
            options: [{ caughtErrors: "all", caughtErrorsIgnorePattern: "^ignore" }],
            errors: [definedError("err", ". Allowed unused args must match /^ignore/u")]
        },
        {
            code: "try{}catch(err){};",
            options: [{ caughtErrors: "all", varsIgnorePattern: "^err" }],
            errors: [definedError("err")]
        },

        // multiple try catch with one success
        {
            code: "try{}catch(ignoreErr){}try{}catch(err){};",
            options: [{ caughtErrors: "all", caughtErrorsIgnorePattern: "^ignore" }],
            errors: [definedError("err", ". Allowed unused args must match /^ignore/u")]
        },

        // multiple try catch both fail
        {
            code: "try{}catch(error){}try{}catch(err){};",
            options: [{ caughtErrors: "all", caughtErrorsIgnorePattern: "^ignore" }],
            errors: [
                definedError("error", ". Allowed unused args must match /^ignore/u"),
                definedError("err", ". Allowed unused args must match /^ignore/u")
            ]
        },

        // caughtErrors with other configs
        {
            code: "try{}catch(err){};",
            options: [{ vars: "all", args: "all", caughtErrors: "all" }],
            errors: [definedError("err")]
        },


Review comment (suggestion):
Let's also add one test case as specified in the issue.

```js
        {
            code: "try{}catch(err){};",
            options: [{ caughtErrors: "all", varsIgnorePattern: "^." }],
            errors: [definedError("err")]
        },
```

Code after:
            code: "export default (a) => {};",
            languageOptions: { ecmaVersion: 6, sourceType: "module" },
            errors: [definedError("a")]
        },
        {
            code: "export default (a, b) => { console.log(a); };",
            languageOptions: { ecmaVersion: 6, sourceType: "module" },
            errors: [definedError("b")]
        },

        // caughtErrors
        {
            code: "try{}catch(err){};",
            options: [{ caughtErrors: "all" }],
            errors: [definedError("err")]
        },
        {
            code: "try{}catch(err){};",
            options: [{ caughtErrors: "all", caughtErrorsIgnorePattern: "^ignore" }],
            errors: [definedError("err", ". Allowed unused args must match /^ignore/u")]
        },
        {
            code: "try{}catch(err){};",
            options: [{ caughtErrors: "all", varsIgnorePattern: "^err" }],
            errors: [definedError("err")]
        },
        {
            code: "try{}catch(err){};",
            options: [{ caughtErrors: "all", varsIgnorePattern: "^." }],
            errors: [definedError("err")]
        },

        // multiple try catch with one success
        {
            code: "try{}catch(ignoreErr){}try{}catch(err){};",
            options: [{ caughtErrors: "all", caughtErrorsIgnorePattern: "^ignore" }],
            errors: [definedError("err", ". Allowed unused args must match /^ignore/u")]
        },

        // multiple try catch both fail
        {
            code: "try{}catch(error){}try{}catch(err){};",
            options: [{ caughtErrors: "all", caughtErrorsIgnorePattern: "^ignore" }],
            errors: [
                definedError("error", ". Allowed unused args must match /^ignore/u"),
                definedError("err", ". Allowed unused args must match /^ignore/u")
            ]
        },

        // caughtErrors with other configs
        {