pulse
pulse copied to clipboard
'window' is defined but never used
Randomly spotted in /src/lib/measurement.js:7 that we're defining a window
argument in the BaseMeasurement#constructor()
, but never using it (using tab.window
instead):
export default class BaseMeasurement {
constructor(tab, window, survey) {
this.tab = tab;
this.window = viewFor(tab.window);
this.survey = survey;
this.logger = new Logger(
`sdk.measurement.${this.constructor.name.toLowerCase()}`,
this.window.console
);
}
Here's my tweak to the .eslintrc file:
"rules": {
"quotes": ["error", "single"],
"no-unused-vars": ["error", {"vars": "all", "args": "all"}],
"no-undef": "error"
}
$ npm run lint
> [email protected] lint /Users/pdehaan/dev/github/mozilla/pulse
> eslint .
/Users/pdehaan/dev/github/mozilla/pulse/src/lib/measurement.js
7:20 error 'window' is defined but never used no-unused-vars
/Users/pdehaan/dev/github/mozilla/pulse/webpack.config.js
19:6 error 'context' is defined but never used no-unused-vars