-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace tslint with typescript-eslint (#1030)
* Add basic eslint 9 flat config * Add @eslint/js and typescript-eslint * Fix some errors, mostly type imports and git add . * Fix some lint errors * Fix lint issues * This works * Run prettier * Remove unused @ts-expect-error * Add comment to eslint.config.mjs * Add stylistic rules and turn off majority * Enable no-inferrable-types & prefer-for-of rules * Format code * Enable consistent-type-assertions rule * Enable no-confusing-non-null-assertion rule * Fix few lint issues & turn off erroring rules
- Loading branch information
Showing
87 changed files
with
571 additions
and
714 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import eslint from "@eslint/js"; | ||
import tseslint from "typescript-eslint"; | ||
|
||
export default tseslint.config( | ||
eslint.configs.recommended, | ||
...tseslint.configs.recommended, | ||
...tseslint.configs.stylistic, | ||
{ | ||
files: ["packages/*/src/**/*.ts"], | ||
languageOptions: { | ||
parser: tseslint.parser, | ||
// parserOptions: { | ||
// project: true, | ||
// }, | ||
}, | ||
rules: { | ||
"@typescript-eslint/no-unnecessary-type-constraint": "warn", | ||
// Svelte doesn't correctly compile if imports of the generated /modules | ||
// aren't imported as 'import type' in other parts of the generated | ||
// querybuilder, so set this option to ensure we always do that | ||
"@typescript-eslint/consistent-type-imports": "error", | ||
"@typescript-eslint/no-namespace": "off", | ||
"@typescript-eslint/no-explicit-any": "off", | ||
"@typescript-eslint/no-empty-function": "warn", | ||
"@typescript-eslint/ban-ts-comment": "warn", | ||
"no-empty-function": "off", | ||
"@typescript-eslint/class-literal-property-style": "off", | ||
"@typescript-eslint/no-unused-vars": [ | ||
"error", | ||
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" }, | ||
], | ||
// some stylistic rules results with errors, turn them off for now | ||
"@typescript-eslint/consistent-indexed-object-style": "off", | ||
"@typescript-eslint/consistent-type-definitions": "off", | ||
"@typescript-eslint/no-empty-interface": "off", | ||
}, | ||
} | ||
); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,19 +7,15 @@ | |
], | ||
"packageManager": "[email protected]", | ||
"devDependencies": { | ||
"@typescript-eslint/eslint-plugin": "^5.60.1", | ||
"@typescript-eslint/parser": "^5.60.1", | ||
"eslint": "^8.43.0", | ||
"eslint-config-prettier": "^8.8.0", | ||
"@eslint/js": "^9.2.0", | ||
"eslint": "^9.2.0", | ||
"prettier": "^2.8.8", | ||
"tslint": "^6.1.3", | ||
"tslint-config-prettier": "^1.18.0", | ||
"tslint-plugin-prettier": "^2.3.0", | ||
"typescript": "^5.4.5" | ||
"typescript": "^5.4.5", | ||
"typescript-eslint": "^7.8.0" | ||
}, | ||
"scripts": { | ||
"lint": "tslint 'packages/*/src/**/*.ts'", | ||
"eslint": "eslint 'packages/*/src/**/*.ts'", | ||
"lint": "eslint --quiet 'packages/*/src/**/*.ts'", | ||
"lint:fix": "eslint 'packages/*/src/**/*.ts' --fix", | ||
"format:check": "prettier --check 'packages/*/src/**/*.(mts|ts)' 'packages/*/test/**/*.ts'", | ||
"format": "prettier --write 'packages/*/src/**/*.(mts|ts)' 'packages/*/test/**/*.ts'", | ||
"generate": "yarn workspace @edgedb/generate generate" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 10 additions & 1 deletion
11
packages/create/src/recipes/nextjs/template/ts/src/app/auth/[...auth]/route.__auth.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/create/src/recipes/nextjs/template/ts/src/pages.__pages/api/hello.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
export function getEnv( | ||
envName: string, | ||
required: boolean = false | ||
): string | undefined { | ||
export function getEnv(envName: string, _required = false): string | undefined { | ||
return process.env[envName]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.