Repository: eslint/eslint
File: tests/lib/rules/id-length.js (JavaScript)

Code before:
        { code: "for (var i=0; i < 10; i++) { console.log(i); }", errors: [tooShortError] },
        { code: "var j=0; while (j > -10) { console.log(--j); }", errors: [tooShortError] },
        { code: "var [i] = arr;", languageOptions: { ecmaVersion: 6 }, errors: [tooShortError] },
        { code: "var [,i,a] = arr;", languageOptions: { ecmaVersion: 6 }, errors: [tooShortError, tooShortError] },
        { code: "function foo([a]) {}", languageOptions: { ecmaVersion: 6 }, errors: [tooShortError] },
        { code: "import x from 'module';", languageOptions: { ecmaVersion: 6 }, errors: [tooShortError] },
        { code: "import * as x from 'module';", languageOptions: { ecmaVersion: 6 }, errors: [tooShortError] },
        { code: "import { x } from 'module';", languageOptions: { ecmaVersion: 6 }, errors: [tooShortError] },
        {
            code: "import longName from 'module';",
            options: [{ max: 5 }],
            languageOptions: { ecmaVersion: 6 },
            errors: [tooLongError]
        },
        {
            code: "import * as longName from 'module';",
            options: [{ max: 5 }],
            languageOptions: { ecmaVersion: 6 },
            errors: [tooLongError]
        },
        {
            code: "import { longName } from 'module';",
            options: [{ max: 5 }],
            languageOptions: { ecmaVersion: 6 },
            errors: [tooLongError]
        },
        {
            code: "var _$xt_$ = Foo(42)",
            options: [{ min: 2, max: 4 }],
            errors: [
                tooLongError
            ]
        },
        {
            code: "var _$x$_t$ = Foo(42)",
            options: [{ min: 2, max: 4 }],
            errors: [
                tooLongError
            ]
        },
        {
            code: "var toString;",
            options: [{ max: 5 }],
            errors: [
                tooLongError
            ]
        },
        {
            code: "(a) => { a * a };",
            languageOptions: { ecmaVersion: 6 },
            errors: [

Review comment (suggestion):
```suggestion
        {
            code: "import * as longName from 'module';",
            options: [{ max: 5 }],
            languageOptions: { ecmaVersion: 6 },
            errors: [tooLongError]
        },
```

Code after:
        { code: "var handler = function (e) {};", errors: [tooShortError] },
        { code: "for (var i=0; i < 10; i++) { console.log(i); }", errors: [tooShortError] },
        { code: "var j=0; while (j > -10) { console.log(--j); }", errors: [tooShortError] },
        { code: "var [i] = arr;", languageOptions: { ecmaVersion: 6 }, errors: [tooShortError] },
        { code: "var [,i,a] = arr;", languageOptions: { ecmaVersion: 6 }, errors: [tooShortError, tooShortError] },
        { code: "function foo([a]) {}", languageOptions: { ecmaVersion: 6 }, errors: [tooShortError] },
        { code: "import x from 'module';", languageOptions: { ecmaVersion: 6 }, errors: [tooShortError] },
        { code: "import * as x from 'module';", languageOptions: { ecmaVersion: 6 }, errors: [tooShortError] },
        {
            code: "import longName from 'module';",
            options: [{ max: 5 }],
            languageOptions: { ecmaVersion: 6 },
            errors: [tooLongError]
        },
        {
            code: "import * as longName from 'module';",
            options: [{ max: 5 }],
            languageOptions: { ecmaVersion: 6 },
            errors: [tooLongError]
        },
        {
            code: "var _$xt_$ = Foo(42)",
            options: [{ min: 2, max: 4 }],
            errors: [
                tooLongError
            ]
        },
        {
            code: "var _$x$_t$ = Foo(42)",
            options: [{ min: 2, max: 4 }],
            errors: [
                tooLongError
            ]
        },
        {
            code: "var toString;",
            options: [{ max: 5 }],
            errors: [
                tooLongError
            ]
        },
        {
            code: "(a) => { a * a };",
            languageOptions: { ecmaVersion: 6 },
            errors: [
                tooShortError
            ]
        },
        {
            code: "function foo(x = 0) { }",
            languageOptions: { ecmaVersion: 6 },