eslint-plugin-prefer-arrow-functions icon indicating copy to clipboard operation
eslint-plugin-prefer-arrow-functions copied to clipboard

static private methods are formatted incorrectly with `classPropertiesAllowed: true`

Open gurgunday opened this issue 1 year ago • 0 comments

Code:

  static #table(pattern) {
    const table = new Uint8Array(256).fill(pattern.length);

    for (let i = 0, length = pattern.length - 1; i !== length; ++i) {
      table[pattern[i]] = length - i;
    }

    return table;
  }

Formatted:

  static table = (pattern) => {
    const table = new Uint8Array(256).fill(pattern.length);

    for (let i = 0, length = pattern.length - 1; i !== length; ++i) {
      table[pattern[i]] = length - i;
    }

    return table;
  };

It should be:

  static #table = (pattern) => {
    const table = new Uint8Array(256).fill(pattern.length);

    for (let i = 0, length = pattern.length - 1; i !== length; ++i) {
      table[pattern[i]] = length - i;
    }

    return table;
  };

gurgunday avatar Sep 27 '24 10:09 gurgunday