Skip to content

Conversation

@btecu
Copy link
Contributor

@btecu btecu commented Mar 11, 2020

No description provided.

@adumesny adumesny changed the title Fix lint command on Windows TS: Fix lint command on Windows Mar 11, 2020
@adumesny adumesny merged commit cdef4b7 into gridstack:typescript Mar 11, 2020
@adumesny
Copy link
Member

sweet, thanks!

'indent': ['error', 2],
'max-len': ['error', 180],
'no-trailing-spaces': 'error',
'prefer-const': 0
Copy link
Member

Choose a reason for hiding this comment

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

should that be true instead ? vscode was hitting at using const instead of let anyway... we can tighten the lint rules once we get it mostly working. forcing not any type would like force us to think hard about what types we passing around and fix jq vs element issues for one thing...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I prefer using const only for outside of class declaration, similar to const in other programming languages.

For most variables, use let. For constants, use const. Constants should be declared at the top of modules and only in module scope.
My views of const vs let are aligned with this article: https://madhatted.com/2016/1/25/let-it-be

Copy link
Contributor Author

Choose a reason for hiding this comment

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

By default I believe prefer-const is set to true.
I turned removed the off flag because I saw you were changing let to const.

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