blabla1337 / skf-flask

Security Knowledge Framework (SKF) Python Flask / Angular project
https://www.securityknowledgeframework.org
Apache License 2.0
807 stars 308 forks source link

Lint source files #755

Closed lfservin closed 2 years ago

lfservin commented 2 years ago

Problem: running

npm run-script lint

throws plenty issues.

Expectation: lint runs cleanly

I have fixed some of them (pull request will follow), but there are still plenty to be fixed. Here's a list of potential problems in the code. Perhaps the most critical of them is that skf uses 'Object' and it shouldn't, based on typescript's messages when linting:

# times Messages
125 variable name must be in lowerCamelCase, PascalCase or UPPER_CASE
104 " should be '
67 object access via string literals is disallowed
46 Don't use 'Object' as a type. Avoid using the Object type. Did you mean object?
27 asterisks in jsdoc must be aligned
23 jsdoc is not formatted correctly on this line
14 Forbidden 'var' keyword, use 'let' or 'const' instead
13 comment must start with a space
11 Unnecessarily quoted property 'Authorization' found.
9 Exceeds maximum line length of 140
7 Unnecessarily quoted property 'id' found.
6
4 Unnecessarily quoted property 'title' found.
4 Unnecessarily quoted property 'question' found.
4 Unnecessarily quoted property 'checklist_type' found.
4 Type boolean trivially inferred from a boolean literal, remove type annotation
2 Unnecessarily quoted property 'sprint_id' found.
2 Unnecessarily quoted property 'result' found.
2 Unnecessarily quoted property 'question_id' found.
2 Unnecessarily quoted property 'project_id' found.
2 statements are not aligned
2 non-arrow functions are forbidden
2 Identifier 'values' is never reassigned; use 'const' instead of 'var'.
2 Identifier 'username' is never reassigned; use 'const' instead of 'let'.
2 Identifier 'priv' is never reassigned; use 'const' instead of 'var'.
2 Identifier 'password' is never reassigned; use 'const' instead of 'let'.
2 Identifier 'jsonPayload' is never reassigned; use 'const' instead of 'var'.
2 Identifier 'base64Url' is never reassigned; use 'const' instead of 'var'.
2 Identifier 'base64' is never reassigned; use 'const' instead of 'var'.
1 Unnecessarily quoted property 'kb_id' found.
1 Type string trivially inferred from a string literal, remove type annotation
1 Identifier 'visibility' is never reassigned; use 'const' instead of 'let'.
1 Identifier 'user_id' is never reassigned; use 'const' instead of 'let'.
1 Identifier 'priviledge' is never reassigned; use 'const' instead of 'let'.
1 Identifier 'pet' is never reassigned; use 'const' instead of 'var'.
1 Identifier 'name' is never reassigned; use 'const' instead of 'let'.
1 Identifier 'lab_split' is never reassigned; use 'const' instead of 'var'.
1 Identifier 'kb_item' is never reassigned; use 'const' instead of 'var'.
1 Identifier 'email' is never reassigned; use 'const' instead of 'let'.
1 Identifier 'description' is never reassigned; use 'const' instead of 'let'.
1 Identifier 'accessToken' is never reassigned; use 'const' instead of 'let'.
1 /home/lservin/dev/skf-flask/Angular2
1 for (... in ...) statements must be filtered with an if statement
1 Don't use 'String' as a type. Avoid using the String type. Did you mean string?
1 Don't use 'Number' as a type. Avoid using the Number type. Did you mean number?
1 Class name must be in pascal case
RiieCco commented 2 years ago

The entire front-end gets a overhaul by real front-end experts instead of SKF core team (which are pretty much all backend devs). They will also improve QA of front-end.