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

Triage and fix some eslint rules #55136

Merged
merged 3 commits into from
Jul 24, 2023
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
19 changes: 10 additions & 9 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"dot-notation": "error",
"eqeqeq": "error",
"no-caller": "error",
"no-constant-condition": ["error", { "checkLoops": false }],
"no-eval": "error",
"no-extra-bind": "error",
"no-new-func": "error",
Expand All @@ -57,6 +58,13 @@
"prefer-object-spread": "error",
"unicode-bom": ["error", "never"],

// Enabled in eslint:recommended, but not applicable here
"no-extra-boolean-cast": "off",
"no-case-declarations": "off",
"no-cond-assign": "off",
"no-control-regex": "off",
"no-inner-declarations": "off",

// @typescript-eslint/eslint-plugin
"@typescript-eslint/naming-convention": [
"error",
Expand All @@ -79,22 +87,15 @@
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-non-null-asserted-optional-chain": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-empty-interface": "off",
Copy link
Member Author

Choose a reason for hiding this comment

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

This one deserves an explanation; while it's definitely bad to have empty interfaces, we seem to have quite a few cases which are "valid" in that they do things like rebinding another interface with new type variables (many in types), providing an interface that is augmented elsewhere (SourceFile), and so on.

"@typescript-eslint/no-explicit-any": "off",

// Todo: For each of these, investigate whether we want to enable them ✨
"@typescript-eslint/ban-types": "off",
"no-case-declarations": "off",
"no-cond-assign": "off",
"no-constant-condition": "off",
"no-control-regex": "off",
"no-debugger": "off",
"no-extra-boolean-cast": "off",
"no-inner-declarations": "off",
"no-useless-escape": "off",
"prefer-rest-params": "off",
"prefer-spread": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": "off",

// Pending https://github.com/typescript-eslint/typescript-eslint/issues/4820
Expand Down
1 change: 1 addition & 0 deletions src/compiler/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ export namespace Debug {
}

export function fail(message?: string, stackCrawlMark?: AnyFunction): never {
// eslint-disable-next-line no-debugger
debugger;
const e = new Error(message ? `Debug Failure. ${message}` : "Debug Failure.");
if ((Error as any).captureStackTrace) {
Expand Down
1 change: 0 additions & 1 deletion src/compiler/watchPublic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,6 @@ export function createWatchProgram<T extends BuilderProgram>(host: WatchCompiler
if (hasChangedCompilerOptions) {
newLine = updateNewLine();
if (program && changesAffectModuleResolution(program.getCompilerOptions(), compilerOptions)) {
debugger;
resolutionCache.onChangesAffectModuleResolution();
}
}
Expand Down