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

Lint the whole codebase #422

Open
thewilkybarkid opened this issue Nov 2, 2021 · 2 comments
Open

Lint the whole codebase #422

thewilkybarkid opened this issue Nov 2, 2021 · 2 comments

Comments

@thewilkybarkid
Copy link
Member

thewilkybarkid commented Nov 2, 2021

ESLint has only been enabled for the src/backend directory, and, seemingly only JavaScript files.

All code should be listed.

Refs #395

thewilkybarkid added a commit that referenced this issue Nov 2, 2021
ESLint appears on only lint .js files by default.

I expect this CI build to fail as it reveals linting problems in TypeScript files.

Refs #398, #422
thewilkybarkid added a commit that referenced this issue Nov 2, 2021
I'm not sure why @typescript-eslint/typescript-estree has been used: I can't see any useful information about it. All documentation points to using @typescript-eslint/parser, which has been installed already. The only noticeable difference is that it doesn't understand when a type has been used, leading to @typescript-eslint/no-unused-vars errors.

I've added a separate TypeScript config file that includes all files in the codebase, as the new parser will error if it tries to load a file that hasn't been included.

Refs #398, #422, ba132cc
thewilkybarkid added a commit that referenced this issue Nov 2, 2021
thewilkybarkid added a commit that referenced this issue Nov 2, 2021
When using reflect-metadata Mikro ORM needs property types to be defined, even if the compiler can infer them. This conflicts with an ESLint rule, so this change disables the rule for the ORM entities' directory.

Refs #422, ba132cc
thewilkybarkid added a commit that referenced this issue Nov 2, 2021
thewilkybarkid added a commit that referenced this issue Nov 3, 2021
This change makes the JavaScript and TypeScript ESLint extensions match.

Refs #422
thewilkybarkid added a commit that referenced this issue Nov 3, 2021
Rather than running ESLint on a single subfolder, this uses an ignore file to exclude files that aren't lint correctly.

Refs #422
thewilkybarkid added a commit that referenced this issue Nov 3, 2021
thewilkybarkid added a commit that referenced this issue Nov 3, 2021
@thewilkybarkid
Copy link
Member Author

The only unlinted code is the frontend, which unfortunately has a lot of errors.

@thewilkybarkid
Copy link
Member Author

@typescript-eslint/recommended-requiring-type-checking should be used too.

thewilkybarkid added a commit that referenced this issue Nov 4, 2021
This change enables TypeScript's strict mode, which allows various bugs to be revealed and shows areas that remain untyped.

As there are many things to fix, I've added an optional step to the CI workflow.

Refs #398, #422
thewilkybarkid added a commit that referenced this issue Nov 4, 2021
As typechecking is separate from running code, ts-node needs to have it explicitly disabled. We've only noticed this problem once TypeScript's strict mode was enabled, as there are currently type problems.

As an aside, this will also be fractionally quicker.

Refs #398, #422, 163bd96
thewilkybarkid added a commit that referenced this issue Nov 4, 2021
thewilkybarkid added a commit that referenced this issue Nov 8, 2021
thewilkybarkid added a commit that referenced this issue Nov 8, 2021
This change removes the untyped getActivePersona function, which doesn't do anything useful.

Refs #398, #422
thewilkybarkid added a commit that referenced this issue Nov 9, 2021
thewilkybarkid added a commit that referenced this issue Nov 26, 2021
ESLint 8 is available, but eslint-plugin-promise doesn't yet support it.

Refs #422, eslint-community/eslint-plugin-promise#218
thewilkybarkid added a commit that referenced this issue Nov 29, 2021
As the reflect-metadata library is no longer used, we no longer need to define inferrable types.

Refs #422, 58efacb
thewilkybarkid added a commit that referenced this issue Jan 6, 2022
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

No branches or pull requests

1 participant