ESLint Error
-
When accepting emoji PRs, saw this:
Err...hmmm...
> @ test /home/travis/build/boomzillawtf/tdwtf > npm-run-all eslint lesshint space > @ eslint /home/travis/build/boomzillawtf/tdwtf > eslint --report-unused-disable-directives --cache plugins/nodebb-plugin-tdwtf-customizations /home/travis/build/boomzillawtf/tdwtf/plugins/nodebb-plugin-tdwtf-customizations/index.js 28:31 error Parsing error: Unexpected token function ✖ 1 problem (1 error, 0 warnings)
OK...what is that? Here is the commit what broke it:
- SocketPosts.getVoters = function (socket, data, callback) { + SocketPosts.getVoters = async function (socket, data) {
-
Inb4 all vote data is either deleted or made public
-
@boomzilla said in ESLint Error:
When accepting emoji PRs, saw this:
Err...hmmm...
> @ test /home/travis/build/boomzillawtf/tdwtf > npm-run-all eslint lesshint space > @ eslint /home/travis/build/boomzillawtf/tdwtf > eslint --report-unused-disable-directives --cache plugins/nodebb-plugin-tdwtf-customizations /home/travis/build/boomzillawtf/tdwtf/plugins/nodebb-plugin-tdwtf-customizations/index.js 28:31 error Parsing error: Unexpected token function ✖ 1 problem (1 error, 0 warnings)
OK...what is that? Here is the commit what broke it:
- SocketPosts.getVoters = function (socket, data, callback) { + SocketPosts.getVoters = async function (socket, data) {
Most likely you want this:
SocketPosts.getVoters = async (socket, data) => {
Either that or your eslint version (or ruleset) is not prepared for async/await functions.
-
@Vixen said in ESLint Error:
Most likely you want this:
SocketPosts.getVoters = async (socket, data) => {Assuming that function doesn't use
this
(protip: don't).I'm guessing, just based on convention that this is a static method (SocketPosts is PascalCase, implying a constructor or namespace; also, an instance method should be assigned to the prototype) so it's probably not a problem. is that we can only assume this, based on available information.
-
@error said in ESLint Error:
based on available information
You could look at the rest of the code in the commit linked , and/or previous revisions of that fi-- Watch out, it's coming right for us!
-
@error said in ESLint Error:
@Vixen said in ESLint Error:
Most likely you want this:
SocketPosts.getVoters = async (socket, data) => {Assuming that function doesn't use
this
(protip: don't).Only in comments and strings.
I'm guessing, just based on convention that this is a static method (SocketPosts is PascalCase, implying a constructor or namespace; also, an instance method should be assigned to the prototype) so it's probably not a problem. is that we can only assume this, based on available information.
Link to the file. This is the thing that replaces my main avatar when displaying downvotes. Which...don't seem to be displayed any more at all so can probably just be deleted.
-
@boomzilla said in ESLint Error:
var reallyDumbObfuscationMethod = crypto.createHash('sha1').update(data.req.ip + nconf.get('secret')).digest();
:chefkiss:
-
@boomzilla said in ESLint Error:
Which...don't seem to be displayed any more at all so can probably just be deleted.
I think they're still there
e: Yep
-
@hungrier said in ESLint Error:
@boomzilla said in ESLint Error:
Which...don't seem to be displayed any more at all so can probably just be deleted.
I think they're still there
e: YepHmm....they're back! They were definitely gone for a while.
-
Awesome. Is this an easter egg or has it ever been mentioned before?
-
-
This post is deleted!