---
source: crates/oxc_linter/src/tester.rs
---
  ⚠ eslint(func-names): Unexpected unnamed function.
   ╭─[func_names.tsx:1:21]
 1 │ Foo.prototype.bar = function() {};
   ·                     ────────
   ╰────
  help: Consider giving this function expression a name.

  ⚠ eslint(func-names): Unexpected unnamed function.
   ╭─[func_names.tsx:1:2]
 1 │ (function(){}())
   ·  ────────
   ╰────
  help: Consider giving this function expression a name.

  ⚠ eslint(func-names): Unexpected unnamed function.
   ╭─[func_names.tsx:1:3]
 1 │ f(function(){})
   ·   ────────
   ╰────
  help: Consider giving this function expression a name.

  ⚠ eslint(func-names): Unexpected unnamed function.
   ╭─[func_names.tsx:1:18]
 1 │ var a = new Date(function() {});
   ·                  ────────
   ╰────
  help: Consider giving this function expression a name.

  ⚠ eslint(func-names): Unexpected unnamed function.
   ╭─[func_names.tsx:1:12]
 1 │ var test = function(d, e, f) {};
   ·            ────────
   ╰────
  help: Consider giving this function expression a name.

  ⚠ eslint(func-names): Unexpected unnamed function.
   ╭─[func_names.tsx:1:5]
 1 │ new function() {}
   ·     ────────
   ╰────
  help: Consider giving this function expression a name.

  ⚠ eslint(func-names): Unexpected unnamed function.
   ╭─[func_names.tsx:1:21]
 1 │ Foo.prototype.bar = function() {};
   ·                     ────────
   ╰────
  help: Consider giving this function expression a name.

  ⚠ eslint(func-names): Unexpected unnamed function.
   ╭─[func_names.tsx:1:2]
 1 │ (function(){}())
   ·  ────────
   ╰────
  help: Consider giving this function expression a name.

  ⚠ eslint(func-names): Unexpected unnamed function.
   ╭─[func_names.tsx:1:3]
 1 │ f(function(){})
   ·   ────────
   ╰────
  help: Consider giving this function expression a name.

  ⚠ eslint(func-names): Unexpected unnamed function.
   ╭─[func_names.tsx:1:18]
 1 │ var a = new Date(function() {});
   ·                  ────────
   ╰────
  help: Consider giving this function expression a name.

  ⚠ eslint(func-names): Unexpected unnamed function.
   ╭─[func_names.tsx:1:5]
 1 │ new function() {}
   ·     ────────
   ╰────
  help: Consider giving this function expression a name.

  ⚠ eslint(func-names): Unexpected unnamed function.
   ╭─[func_names.tsx:1:13]
 1 │ var {foo} = function(){};
   ·             ────────
   ╰────
  help: Consider giving this function expression a name.

  ⚠ eslint(func-names): Unexpected unnamed function.
   ╭─[func_names.tsx:1:18]
 1 │ ({ a: obj.prop = function(){} } = foo);
   ·                  ────────
   ╰────
  help: Consider giving this function expression a name.

  ⚠ eslint(func-names): Unexpected unnamed function.
   ╭─[func_names.tsx:1:13]
 1 │ [obj.prop = function(){}] = foo;
   ·             ────────
   ╰────
  help: Consider giving this function expression a name.

  ⚠ eslint(func-names): Unexpected unnamed function.
   ╭─[func_names.tsx:1:16]
 1 │ var { a: [b] = function(){} } = foo;
   ·                ────────
   ╰────
  help: Consider giving this function expression a name.

  ⚠ eslint(func-names): Unexpected unnamed function.
   ╭─[func_names.tsx:1:22]
 1 │ function foo({ a } = function(){}) {};
   ·                      ────────
   ╰────
  help: Consider giving this function expression a name.

  ⚠ eslint(func-names): Unexpected named function foo.
   ╭─[func_names.tsx:1:9]
 1 │ var x = function foo() {};
   ·         ────────────
   ╰────
  help: Remove the name on this function expression.

  ⚠ eslint(func-names): Unexpected named function foo.
   ╭─[func_names.tsx:1:21]
 1 │ Foo.prototype.bar = function foo() {};
   ·                     ────────────
   ╰────
  help: Remove the name on this function expression.

  ⚠ eslint(func-names): Unexpected named function foo.
   ╭─[func_names.tsx:1:8]
 1 │ ({foo: function foo() {}})
   ·        ────────────
   ╰────
  help: Remove the name on this function expression.

  ⚠ eslint(func-names): Unexpected unnamed function.
   ╭─[func_names.tsx:1:16]
 1 │ export default function() {}
   ·                ────────
   ╰────
  help: Consider giving this function expression a name.

  ⚠ eslint(func-names): Unexpected unnamed function.
   ╭─[func_names.tsx:1:16]
 1 │ export default function() {}
   ·                ────────
   ╰────
  help: Consider giving this function expression a name.

  ⚠ eslint(func-names): Unexpected unnamed function.
   ╭─[func_names.tsx:1:17]
 1 │ export default (function(){});
   ·                 ────────
   ╰────
  help: Consider giving this function expression a name.

  ⚠ eslint(func-names): Unexpected unnamed generator function.
   ╭─[func_names.tsx:1:15]
 1 │ var foo = bar(function *() {});
   ·               ──────────
   ╰────
  help: Consider giving this function expression a name.

  ⚠ eslint(func-names): Unexpected unnamed generator function.
   ╭─[func_names.tsx:1:11]
 1 │ var foo = function*() {};
   ·           ─────────
   ╰────
  help: Consider giving this function expression a name.

  ⚠ eslint(func-names): Unexpected unnamed generator function.
   ╭─[func_names.tsx:1:2]
 1 │ (function*() {}())
   ·  ─────────
   ╰────
  help: Consider giving this function expression a name.

  ⚠ eslint(func-names): Unexpected unnamed generator function.
   ╭─[func_names.tsx:1:15]
 1 │ var foo = bar(function *() {});
   ·               ──────────
   ╰────
  help: Consider giving this function expression a name.

  ⚠ eslint(func-names): Unexpected unnamed generator function.
   ╭─[func_names.tsx:1:11]
 1 │ var foo = function*() {};
   ·           ─────────
   ╰────
  help: Consider giving this function expression a name.

  ⚠ eslint(func-names): Unexpected unnamed generator function.
   ╭─[func_names.tsx:1:2]
 1 │ (function*() {}())
   ·  ─────────
   ╰────
  help: Consider giving this function expression a name.

  ⚠ eslint(func-names): Unexpected unnamed generator function.
   ╭─[func_names.tsx:1:15]
 1 │ var foo = bar(function *() {});
   ·               ──────────
   ╰────
  help: Consider giving this function expression a name.

  ⚠ eslint(func-names): Unexpected unnamed generator function.
   ╭─[func_names.tsx:1:2]
 1 │ (function*() {}())
   ·  ─────────
   ╰────
  help: Consider giving this function expression a name.

  ⚠ eslint(func-names): Unexpected unnamed generator function.
   ╭─[func_names.tsx:1:15]
 1 │ var foo = bar(function *() {});
   ·               ──────────
   ╰────
  help: Consider giving this function expression a name.

  ⚠ eslint(func-names): Unexpected unnamed generator function.
   ╭─[func_names.tsx:1:2]
 1 │ (function*() {}())
   ·  ─────────
   ╰────
  help: Consider giving this function expression a name.

  ⚠ eslint(func-names): Unexpected unnamed generator function.
   ╭─[func_names.tsx:1:15]
 1 │ var foo = bar(function *() {});
   ·               ──────────
   ╰────
  help: Consider giving this function expression a name.

  ⚠ eslint(func-names): Unexpected unnamed generator function.
   ╭─[func_names.tsx:1:11]
 1 │ var foo = function*() {};
   ·           ─────────
   ╰────
  help: Consider giving this function expression a name.

  ⚠ eslint(func-names): Unexpected unnamed generator function.
   ╭─[func_names.tsx:1:2]
 1 │ (function*() {}())
   ·  ─────────
   ╰────
  help: Consider giving this function expression a name.

  ⚠ eslint(func-names): Unexpected unnamed generator function.
   ╭─[func_names.tsx:1:15]
 1 │ var foo = bar(function *() {});
   ·               ──────────
   ╰────
  help: Consider giving this function expression a name.

  ⚠ eslint(func-names): Unexpected unnamed generator function.
   ╭─[func_names.tsx:1:2]
 1 │ (function*() {}())
   ·  ─────────
   ╰────
  help: Consider giving this function expression a name.

  ⚠ eslint(func-names): Unexpected unnamed generator function.
   ╭─[func_names.tsx:1:15]
 1 │ var foo = bar(function *() {});
   ·               ──────────
   ╰────
  help: Consider giving this function expression a name.

  ⚠ eslint(func-names): Unexpected unnamed generator function.
   ╭─[func_names.tsx:1:11]
 1 │ var foo = function*() {};
   ·           ─────────
   ╰────
  help: Consider giving this function expression a name.

  ⚠ eslint(func-names): Unexpected unnamed generator function.
   ╭─[func_names.tsx:1:2]
 1 │ (function*() {}())
   ·  ─────────
   ╰────
  help: Consider giving this function expression a name.

  ⚠ eslint(func-names): Unexpected unnamed generator function.
   ╭─[func_names.tsx:1:15]
 1 │ var foo = bar(function *() {});
   ·               ──────────
   ╰────
  help: Consider giving this function expression a name.

  ⚠ eslint(func-names): Unexpected unnamed generator function.
   ╭─[func_names.tsx:1:2]
 1 │ (function*() {}())
   ·  ─────────
   ╰────
  help: Consider giving this function expression a name.

  ⚠ eslint(func-names): Unexpected named generator function baz.
   ╭─[func_names.tsx:1:15]
 1 │ var foo = bar(function *baz() {});
   ·               ─────────────
   ╰────
  help: Remove the name on this function expression.

  ⚠ eslint(func-names): Unexpected named generator function baz.
   ╭─[func_names.tsx:1:15]
 1 │ var foo = bar(function *baz() {});
   ·               ─────────────
   ╰────
  help: Remove the name on this function expression.

  ⚠ eslint(func-names): Unexpected named generator function baz.
   ╭─[func_names.tsx:1:15]
 1 │ var foo = bar(function *baz() {});
   ·               ─────────────
   ╰────
  help: Remove the name on this function expression.

  ⚠ eslint(func-names): Unexpected named generator function baz.
   ╭─[func_names.tsx:1:15]
 1 │ var foo = bar(function *baz() {});
   ·               ─────────────
   ╰────
  help: Remove the name on this function expression.

  ⚠ eslint(func-names): Unexpected unnamed method foo.
   ╭─[func_names.tsx:1:17]
 1 │ class C { foo = function() {} }
   ·                 ────────
   ╰────
  help: Consider giving this function expression a name.

  ⚠ eslint(func-names): Unexpected unnamed public method foo.
   ╭─[func_names.tsx:1:24]
 1 │ class C { public foo = function() {} }
   ·                        ────────
   ╰────
  help: Consider giving this function expression a name.

  ⚠ eslint(func-names): Unexpected unnamed method.
   ╭─[func_names.tsx:1:19]
 1 │ class C { [foo] = function() {} }
   ·                   ────────
   ╰────
  help: Consider giving this function expression a name.

  ⚠ eslint(func-names): Unexpected unnamed private method foo.
   ╭─[func_names.tsx:1:18]
 1 │ class C { #foo = function() {} }
   ·                  ────────
   ╰────
  help: Consider giving this function expression a name.

  ⚠ eslint(func-names): Unexpected unnamed function.
   ╭─[func_names.tsx:1:21]
 1 │ class C { foo = bar(function() {}) }
   ·                     ────────
   ╰────
  help: Consider giving this function expression a name.

  ⚠ eslint(func-names): Unexpected named method foo.
   ╭─[func_names.tsx:1:17]
 1 │ class C { foo = function bar() {} }
   ·                 ────────────
   ╰────
  help: Remove the name on this function expression.
