Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ESLint #728

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Add ESLint #728

wants to merge 3 commits into from

Conversation

kibertoad
Copy link
Collaborator

No description provided.

@kibertoad
Copy link
Collaborator Author

@cressie176 Could you please take a look?

Copy link
Collaborator

@cressie176 cressie176 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to the comments, what do you think about a future PR which uses https://www.npmjs.com/package/lint-staged to only check staged files, and potentially running automatically on a commit hook? I'm conscious the more dependencies we add, the more maintenance we incur though.

"caughtErrorsIgnorePattern": "^_"
}
],
"no-cond-assign": "warn",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest we change this to "off" given it's used fairly extensively. Warnings are just annoying.

@@ -179,6 +179,7 @@ class Channel extends BaseChannel {
this.unregisterConsumer(consumerTag);
return ok.fields;
});
return ok
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Returning ok looks like a change in behaviour. Was this previously an omission or just made to appease a linting rule?
What does the Basic Cancel RPC return?
Were the api docs updated?

@@ -105,7 +105,7 @@ function encodeFieldValue(buffer, value, offset) {
var start = offset;
var type = typeof value, val = value;
// A trapdoor for specifying a type, e.g., timestamp
if (value && type === 'object' && value.hasOwnProperty('!')) {
if (value && type === 'object' && Object.prototype.hasOwnProperty.call(value, '!')) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sometimes I hate javascript!

"mocha": "^9.2.2",
"nyc": "^15.1.0",
"uglify-js": "2.8.x"
},
"scripts": {
"test": "make test",
"lint": "eslint \"lib/**/*.js\" channel_api.js callback_api.js",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this catch the generated files? Maybe they should also be ignored (although if they pass, no harm being done currently).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants