dot-notation
)This rule extends the base eslint/dot-notation
rule. It adds support for optionally ignoring computed private
member access.
{ // note you must disable the base rule as it can report incorrect errors "dot-notation": "off", "@typescript-eslint/dot-notation": ["error"] }
See eslint/dot-notation
options. This rule adds the following options:
interface Options extends BaseDotNotationOptions { allowPrivateClassPropertyAccess?: boolean; } const defaultOptions: Options = { ...baseDotNotationDefaultOptions, allowPrivateClassPropertyAccess: false, };
allowPrivateClassPropertyAccess
Example of a correct code when allowPrivateClassPropertyAccess
is set to true
class X { private priv_prop = 123; } const x = new X(); x['priv_prop'] = 123;
Taken with ❤️ from ESLint core