# class-reference-in-static-methods πŸ“ Enforce consistent class references in static methods. πŸ’ΌπŸš« This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config). This rule is _disabled_ in the β˜‘οΈ `unopinionated` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config). πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). This rule enforces either dynamic static dispatch with `this` and `super`, or direct references with class names. By default, it prefers `this` and `super`. ## Examples ```js // ❌ class Foo extends Bar { static baz() { Foo.qux(); Bar.qux(); } } // βœ… class Foo extends Bar { static baz() { this.qux(); super.qux(); } } ``` With `{preferThis: false, preferSuper: false}`: ```js // ❌ class Foo extends Bar { static baz() { this.qux(); super.qux(); } } // βœ… class Foo extends Bar { static baz() { Foo.qux(); Bar.qux(); } } ``` ## Options Type: `object` ### preferThis Type: `boolean`\ Default: `true` Prefer `this` over the current class name in static methods. ### preferSuper Type: `boolean`\ Default: `true` Prefer `super` over the superclass name in static methods.