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): Fix eslint rules #844

Merged
merged 1 commit into from
Aug 12, 2024
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
7 changes: 1 addition & 6 deletions eslint.config.cjs
Copy link
Contributor

Choose a reason for hiding this comment

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

Sanity check, should this get put in the configs repo?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, eslint pre- and post- 9 are very different, including with their supported configs files. This is our only repo that is fully on eslint post-9

Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ module.exports = [
"no-unused-vars": "off",
"no-use-before-define": "off",
"no-useless-constructor": "off",
"@typescript-eslint/lines-between-class-members": [
"error",
"always",
{ exceptAfterSingleLine: true },
],
"@typescript-eslint/naming-convention": [
"error",
{ selector: "typeLike", format: ["PascalCase"] },
Expand Down Expand Up @@ -79,7 +74,7 @@ module.exports = [
],
"import-x/no-unresolved": "off",
"import-x/prefer-default-export": "off",
"lines-between-class-members": "off",
"lines-between-class-members": ["error", "always", { exceptAfterSingleLine: true }],
"max-len": [
"error",
{
Expand Down
2 changes: 1 addition & 1 deletion repo-tools/definition-checker/check.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import fs from "fs";
import path from "path";
// trunk-ignore(eslint/import/no-extraneous-dependencies)
// trunk-ignore(eslint/import-x/no-extraneous-dependencies)
import YAML from "yaml";

// Avoid strictly typing composite config
Expand Down
4 changes: 2 additions & 2 deletions tests/driver/lint_driver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ lint:
(this.getFullTrunkConfig().lint.definitions.find(
({ name }: { name: string }) => name === this.linter,
)?.known_good_version as string) ?? "";
// trunk-ignore(eslint/@typescript-eslint/no-useless-template-literals): Convert kgv to string
// trunk-ignore(eslint/@typescript-eslint/no-unnecessary-template-expression): Convert kgv to string
if (this.linter === "include-what-you-use" && `${kgv}`.length === 3) {
// TODO(Tyler): `trunk config print` does not correctly wrap quotes around kgv, so we must patch iwyu here
return `${kgv}0`;
Expand All @@ -149,7 +149,7 @@ lint:

let newTrunkContents = "<undefined contents>";
try {
// trunk-ignore(eslint/@typescript-eslint/no-useless-template-literals): Cast to string to handle decimal case
// trunk-ignore(eslint/@typescript-eslint/no-unnecessary-template-expression): Cast to string to handle decimal case
const version = `${this.extractLinterVersion()}`;
const versionString = version.length > 0 ? `@${version}` : "";
const linterVersionString = `${this.linter}${versionString}`;
Expand Down
2 changes: 1 addition & 1 deletion tests/driver/tool_driver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ lint:
return;
}
try {
// trunk-ignore(eslint/@typescript-eslint/no-useless-template-literals): Cast to string to handle decimal case
// trunk-ignore(eslint/@typescript-eslint/no-unnecessary-template-expression): Cast to string to handle decimal case
const version = `${this.extractToolVersion()}`;
const versionString = version.length > 0 ? `@${version}` : "";
const toolVersionString = `${this.tool}${versionString}`;
Expand Down
Loading