Skip to content

aws-node-recursive-function: enable eslint#78

Open
christophgysin wants to merge 1 commit intoserverless:masterfrom
christophgysin:enable-eslint
Open

aws-node-recursive-function: enable eslint#78
christophgysin wants to merge 1 commit intoserverless:masterfrom
christophgysin:enable-eslint

Conversation

@christophgysin
Copy link
Copy Markdown
Contributor

Don't disable it globally. Fix issues, and suppress them where needed.

Don't disable it globally. Fix issues, and suppress them where needed.
console.log('recursive call');
/* decrement numberOfCalls so we don't infinitely loop */
event.numberOfCalls = event.numberOfCalls - 1;
event.numberOfCalls -= 1; // eslint-disable-line no-param-reassign
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is harder to read for me =)

Can we keep the original?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

serverless/examples/aws-node-recursive-function/handler.js
 11:5  error  Assignment can be replaced with operator assignment  operator-assignment

This is coming from the airbnb coding style rules:
https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/style.js#L313-L315

I like the shorthand version better, but this is just personal preference.

If you prefer the long version, let's change the config to prevent this:

'operator-assignment': ['never']

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I just tried, and it seems that generate-readme.js is making use of the shorthand version in a couple of places, using md += '...' to concatenate strings.

We could of course also turn the rule off entirely.

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.

2 participants