eslint-plugin-prefer-arrow-functions
eslint-plugin-prefer-arrow-functions copied to clipboard
static private methods are formatted incorrectly with `classPropertiesAllowed: true`
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;
};