diff --git a/examples/bad/es6.js b/examples/bad/es6.js index 6aa2acb..edce7b7 100644 --- a/examples/bad/es6.js +++ b/examples/bad/es6.js @@ -37,3 +37,14 @@ var foo = new Symbol('foo'); // The Symbol constructor is not intended to be use function* foo() { return 10; // This generator functions that do not have the `yield` keyword. } + +/*eslint class-methods-use-this: "error"*/ +class A { + constructor() { + this.a = "hi"; + } + + sayHi() { + console.log("hi"); // The sayHi method doesn’t use this, so we can make it a static method. + } +}