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

Modernize and document common-hid-packet-parser.js #4718

Merged
merged 65 commits into from
Nov 20, 2022
Merged
Show file tree
Hide file tree
Changes from 63 commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
95cc223
Adapted eslint configuration for common-hid-packet-parser.js
JoergAtGithub Apr 5, 2022
e1df6de
Added and improved JSDOC documentation
JoergAtGithub Apr 18, 2022
597d1f2
Use ES6 class syntax
JoergAtGithub Apr 28, 2022
10139a1
Documentation fixes
JoergAtGithub Apr 30, 2022
702986b
Minor documentation corrections
JoergAtGithub May 1, 2022
1d6b976
Added missing definitions/default/comment
JoergAtGithub Jun 6, 2022
3950a59
Merge remote-tracking branch 'upstream/Main' into hid-parser-update
JoergAtGithub Jun 6, 2022
b890d51
Added missing type for bit to JSDoc
JoergAtGithub Jun 6, 2022
d20868e
Made hard understandable code section better readable
JoergAtGithub Jul 9, 2022
5908c8e
Reformated many if statements with line breaks, for better code reada…
JoergAtGithub Jul 9, 2022
2334fbe
Marked HIDDebug as deprecated and replaced the also deprecated print …
JoergAtGithub Jul 9, 2022
a7dca9e
Changed implementation of getOffset, to constant time solution using …
JoergAtGithub Jul 9, 2022
244a0af
Simplify implementation of constructor of HIDPacket
JoergAtGithub Jul 9, 2022
d39f9ab
Added todo hint, that the implementation of getOutputField has a perf…
JoergAtGithub Jul 9, 2022
6300087
Use const for signed state of signedPackFormats, and unified this acr…
JoergAtGithub Jul 9, 2022
a15910d
Replaced variable with a constant
JoergAtGithub Jul 9, 2022
5905de1
Codespell
JoergAtGithub Jul 9, 2022
c37e320
Reformated code to break long lines
JoergAtGithub Jul 10, 2022
419039d
Merge remote-tracking branch 'upstream/Main' into hid-parser-update
JoergAtGithub Jul 23, 2022
5dad81c
Replaced usage of deprecated HIDDebug by console.log, console.warn or…
JoergAtGithub Jul 23, 2022
43f55b6
Made HIDDebug a function of the global-this object to prevent eslint …
JoergAtGithub Jul 23, 2022
6bafa6d
Use JSDoc @todo where applicable
JoergAtGithub Jul 23, 2022
fefd3b3
Fixed several errors
JoergAtGithub Jul 23, 2022
52aaa47
eslint: Make class instances const
JoergAtGithub Jul 23, 2022
ec75622
Fixed bug of duplicated variables for scratch ramp
JoergAtGithub Jul 23, 2022
b6595b5
Defined enableScratchCallback
JoergAtGithub Jul 23, 2022
3ba41fe
Removed argument, which is not existing in constructor
JoergAtGithub Jul 23, 2022
8cb4082
Added @ts-ignore, to inhibit warnings for duplicate identifier
JoergAtGithub Jul 23, 2022
1a3d81f
Corrected type that parseBitVector returns
JoergAtGithub Jul 24, 2022
06bae21
Replaced wrong eslintrc keyword "readable" by "readonly".
JoergAtGithub Jul 24, 2022
801abf5
Adjusted eslint rules for common-hid-packet-parser.js:
JoergAtGithub Jul 24, 2022
796e8e7
Corrected boolean <-> number conversion
JoergAtGithub Jul 24, 2022
3c2ce07
Added guards for safe handling field.value as HIDBitVector
JoergAtGithub Jul 24, 2022
6d0c7ea
Made variables const
JoergAtGithub Jul 24, 2022
49faef9
Reduced scope of change variable and initialize it (in one branch it …
JoergAtGithub Jul 24, 2022
e1b71ce
addControl has no return type -> Do not return undefined
JoergAtGithub Jul 24, 2022
2a63ac5
Added missing type and docu for pack
JoergAtGithub Jul 24, 2022
11202e8
Do not try to initialize field structure again, after usage
JoergAtGithub Jul 24, 2022
0204252
Corrected wrong type syntax
JoergAtGithub Jul 24, 2022
109d2ea
Specified missing type
JoergAtGithub Jul 24, 2022
31bc9ff
Separated types bitObject / packetField
JoergAtGithub Jul 24, 2022
6b31118
Use LED-colors as On / Off values in linkOutput
JoergAtGithub Jul 24, 2022
3c7c70a
Determine size of output array before initializing it, and initialize…
JoergAtGithub Jul 24, 2022
aafed4f
Reduced scope of variables and made them const where possible
JoergAtGithub Jul 24, 2022
2ef4006
Corrected return type of lookupBit
JoergAtGithub Jul 24, 2022
ea29630
Fixed eslint jsdoc/require-property-description warnings by documenti…
JoergAtGithub Jul 25, 2022
2275857
Reverted wrong change of object literal to array, and documented the …
JoergAtGithub Jul 26, 2022
6d0d328
Defined type alias packetItemId
JoergAtGithub Jul 26, 2022
095fe06
Corrected definition of callback types
JoergAtGithub Jul 26, 2022
f69c587
Shortened description of control group and control name arguments
JoergAtGithub Jul 27, 2022
98880d9
Merge remote-tracking branch 'upstream/Main' into hid-parser-update
JoergAtGithub Jul 27, 2022
0478a76
Merge remote-tracking branch 'upstream/Main' into hid-parser-update
JoergAtGithub Aug 14, 2022
af39091
Replaced "Record." by "Object.", because Record is TypeScript syntax …
JoergAtGithub Oct 9, 2022
64251b2
Clarify, that "play" is just an example
JoergAtGithub Oct 9, 2022
9a872e6
Use JSDoc statements for deprecated info of processDelta
JoergAtGithub Oct 9, 2022
651089a
Deprecated unused HIDController.OutputUpdateInterval
JoergAtGithub Oct 9, 2022
96f1052
Used @default syntax - According the JSDoc spec, the value is optiona…
JoergAtGithub Oct 10, 2022
f54a65a
Replaced all strings with embedded expressions by template strings
JoergAtGithub Oct 10, 2022
057ad16
Corrected type of packetField.pack
JoergAtGithub Oct 11, 2022
661ddaa
Added missing type/type cast
JoergAtGithub Oct 11, 2022
42923dc
Added missing @type to HIDPacket.groups
JoergAtGithub Oct 11, 2022
87269ee
This was the only place where the keyword initializePacketData exist …
JoergAtGithub Oct 11, 2022
ea794af
Tried to explain, what this.timers = {}; is used for.
JoergAtGithub Oct 11, 2022
2f05914
Merge remote-tracking branch 'upstream/Main' into hid-parser-update
JoergAtGithub Nov 19, 2022
f0f184a
Fixed accidentally changed return value of HIDModifierList.Get in err…
JoergAtGithub Nov 19, 2022
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
92 changes: 65 additions & 27 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,80 +1,118 @@
{
"extends": ["eslint:recommended", "plugin:jsdoc/recommended"],
"extends": [ "eslint:recommended", "plugin:jsdoc/recommended" ],
"parserOptions": {
"ecmaVersion": 7,
"sourceType": "script"
},
"env": {
"es6": true
},
"plugins": ["jsdoc"],
"plugins": [ "jsdoc" ],
"settings": {
"jsdoc": {
"preferredTypes": {
"object": "Object"
}
}
},
"rules": {
"array-bracket-spacing" : "warn",
"array-bracket-spacing": "warn",
"block-spacing": "warn",
"brace-style": ["warn", "1tbs", {
"brace-style": [
"warn",
"1tbs",
{
"allowSingleLine": true
}],
}
],
"curly": "warn",
"camelcase": "warn",
"comma-spacing": "warn",
"computed-property-spacing" : ["warn", "never", {
"computed-property-spacing": [
"warn",
"never",
{
"enforceForClassMembers": true
}],
"dot-location": ["warn", "property"],
}
],
"dot-location": [ "warn", "property" ],
"dot-notation": "warn",
"eqeqeq": ["error", "always"],
"eqeqeq": [ "error", "always" ],
"func-call-spacing": "warn",
"func-style": ["error", "expression", {
"func-style": [
"error",
"expression",
{
"allowArrowFunctions": true
}],
"indent": ["warn", 4],
}
],
"indent": [ "warn", 4 ],
"key-spacing": "warn",
"keyword-spacing": "warn",
"linebreak-style": ["warn", "unix"],
"linebreak-style": [ "warn", "unix" ],
"newline-per-chained-call": "warn",
"no-constructor-return": "warn",
"no-extra-bind": "warn",
"no-sequences": "warn",
"no-useless-call": "warn",
"no-useless-return": "warn",
"no-trailing-spaces": "warn",
"no-unneeded-ternary": ["warn", {
"no-unneeded-ternary": [
"warn",
{
"defaultAssignment": false
}],
"no-unused-vars": ["error", {
}
],
"no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_"
}],
}
],
"no-var": "warn",
"object-curly-newline" : ["warn", {
"object-curly-newline": [
"warn",
{
"consistent": true,
"multiline": true
}],
"object-curly-spacing" : "warn",
}
],
"object-curly-spacing": "warn",
"prefer-const": "warn",
"prefer-regex-literals": "warn",
"quotes": ["warn", "double"],
"quotes": [ "warn", "double" ],
"require-atomic-updates": "error",
"semi": "warn",
"semi-spacing": "warn",
"space-before-blocks": ["warn", "always"],
"space-before-function-paren": ["warn", "never"],
"space-before-blocks": [ "warn", "always" ],
"space-before-function-paren": [ "warn", "never" ],
"space-in-parens": "warn",
"yoda": "warn"
},
"globals": {
"console": "readable"
"console": "readonly"
},
"overrides": [
{
"files": ["**/*.mjs"],
"files": [ "**/*.mjs" ],
"parserOptions": {
"sourceType": "module"
}
},
{
"files": ["res/controllers/*.js"],
"files": [ "res/controllers/common-hid-packet-parser.js" ],
"globals": {
"console": "readonly"
},
"rules": {
"camelcase": "off"
}
},
{
"files": [ "res/controllers/*.js" ],
"excludedFiles": "res/controllers/common-hid-packet-parser.js",
"globals": {
"console": "readable",
"console": "readonly",
"svg": "writable",
"HIDController": "writable",
"HIDDebug": "writable",
Expand Down
Loading