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

chore: upgrade deps #6

Merged
merged 2 commits into from
Mar 22, 2024
Merged

chore: upgrade deps #6

merged 2 commits into from
Mar 22, 2024

Conversation

jasoniangreen
Copy link
Collaborator

@jasoniangreen jasoniangreen commented Mar 21, 2024

See inline comments for an explanation of each config change. In general these choices were made to give the most protection and ensuring best practices while avoiding large changes in the AJV codebase.

You can see the result of these rules in the AJV PR.

.eslintrc.js Outdated Show resolved Hide resolved
],
rules: {
...jsConfig.rules,
"@typescript-eslint/no-unsafe-argument": "off",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This appears to be a new rule that didn't exist before. We had 123 violations which is too much to fix or disable by line.

"@typescript-eslint/array-type": "error",
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/consistent-type-definitions": "error",
"@typescript-eslint/no-redundant-type-constituents": "error",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

New rule that is on by default it seems, so I added it to be explicit as it seems useful.

"@typescript-eslint/array-type": "error",
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/consistent-type-definitions": "error",
"@typescript-eslint/no-redundant-type-constituents": "error",
"@typescript-eslint/no-shadow": "error",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ported from the js ruleset

"@typescript-eslint/array-type": "error",
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/consistent-type-definitions": "error",
"@typescript-eslint/no-redundant-type-constituents": "error",
"@typescript-eslint/no-shadow": "error",
"@typescript-eslint/no-redeclare": "error",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ported from the js ruleset

"@typescript-eslint/no-redundant-type-constituents": "error",
"@typescript-eslint/no-shadow": "error",
"@typescript-eslint/no-redeclare": "error",
"@typescript-eslint/no-base-to-string": ["error", { ignoredTypeNames: ["Error", "RegExp", "RegExpLike", "URL", "URLSearchParams"] }], // 1 instance
Copy link
Collaborator Author

@jasoniangreen jasoniangreen Mar 21, 2024

Choose a reason for hiding this comment

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

A new rule added by default. I have added some standard exceptions though the one that actually triggered in ajv was RegExpLike.

"@typescript-eslint/no-shadow": "error",
"@typescript-eslint/no-redeclare": "error",
"@typescript-eslint/no-base-to-string": ["error", { ignoredTypeNames: ["Error", "RegExp", "RegExpLike", "URL", "URLSearchParams"] }], // 1 instance
"@typescript-eslint/no-use-before-define": ["error", "nofunc"],
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ported from the js ruleset

@@ -29,7 +34,7 @@ module.exports = {
"no-invalid-this": "off",
"@typescript-eslint/no-invalid-this": "error",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-parameter-properties": "error",
"@typescript-eslint/parameter-properties": ["error", {prefer: "parameter-property"}],
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This way this rule works has been updated.

"no-template-curly-in-string": "error",
"no-trailing-spaces": "error",
"no-undef-init": "error",
"no-use-before-define": ["error", "nofunc"],
"no-use-before-define": "off",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Must be off to enable the TS version.

"husky": "^9.0.11",
"lint-staged": "^15.2.2",
"prettier": "3.0.3",
"typescript": "^4.9.5"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Have updated TS to the same version of the main repo.

@jasoniangreen jasoniangreen merged commit 377d0d0 into master Mar 22, 2024
@jasoniangreen jasoniangreen deleted the chore-upgrade-deps branch March 22, 2024 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants