Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ module.exports = {
rules: {
'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.

'no-trailing-spaces': 'error'
}
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"build": "yarn --no-progress && rm -rf dist/* && webpack && grunt && doctoc ./README.md && doctoc ./doc/README.md && doctoc ./doc/CHANGES.md",
"web": "rm -rf dist/* && webpack",
"test": "yarn lint && karma start karma.conf.js",
"lint": "tsc --noEmit && eslint 'src/**/*.ts'",
"lint": "tsc --noEmit && eslint src/*.ts",
"reset": "rm -rf dist node_modules",
"prepublishOnly": "yarn build"
},
Expand Down