-
-
Notifications
You must be signed in to change notification settings - Fork 372
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tslint is end-of-life, and warns when you install it. Additionally, the version we were on didn't support 'import type' expressions, as well as optional-chaining & null coalescing when I tried to use those in #1204 This PR does update a bunch of tslint-disable comments, but otherwise tries to minimally change runtime source in danger-js. If we want to tighten the eslint rules, I'd be super supportive, but I didn't want to cause a ton of thrash, so mostly the rules that are enabled are the ones that don't trigger on tons of existing code.
- Loading branch information
Showing
46 changed files
with
686 additions
and
137 deletions.
There are no files selected for viewing
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,2 @@ | ||
source/danger.d.ts | ||
source/runner/_tests/fixtures/*.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
es6: true, | ||
node: true, | ||
}, | ||
extends: ["plugin:@typescript-eslint/recommended", "plugin:jest/recommended", "prettier"], | ||
parser: "@typescript-eslint/parser", | ||
parserOptions: { | ||
project: "tsconfig.spec.json", | ||
sourceType: "module", | ||
}, | ||
plugins: ["eslint-plugin-jest", "eslint-plugin-jsdoc", "@typescript-eslint"], | ||
rules: { | ||
"@typescript-eslint/naming-convention": "error", | ||
"@typescript-eslint/no-empty-function": "error", | ||
"@typescript-eslint/no-unused-expressions": "error", | ||
|
||
// Something is grumpy about these rules re: node imports - TODO | ||
"@typescript-eslint/no-require-imports": "off", | ||
"@typescript-eslint/no-var-requires": "off", | ||
|
||
curly: "error", | ||
"jsdoc/check-alignment": "error", | ||
"jsdoc/check-indentation": "off", | ||
"jsdoc/newline-after-description": "off", | ||
"no-empty": "error", | ||
// This is used intentionally in a bunch of ci_source/providers | ||
"no-empty-function": "off", | ||
"no-redeclare": "error", | ||
"no-var": "error", | ||
// There are a bunch of existing uses of 'let' where this rule would trigger | ||
"prefer-const": "off", | ||
|
||
// This project has a ton of interacting APIs, and sometimes it's helpful to be explicit, even if the type is trivial | ||
"@typescript-eslint/no-inferrable-types": "off", | ||
|
||
"no-unused-expressions": "off", | ||
"@typescript-eslint/no-unused-expressions": "error", | ||
|
||
"no-unused-vars": "off", | ||
"@typescript-eslint/no-unused-vars": [ | ||
"warn", | ||
{ | ||
// Allow function args to be unused | ||
args: "none", | ||
argsIgnorePattern: "^_", | ||
varsIgnorePattern: "^_", | ||
caughtErrorsIgnorePattern: "^_", | ||
}, | ||
], | ||
|
||
"jest/no-disabled-tests": "warn", | ||
"jest/no-focused-tests": "error", | ||
"jest/no-identical-title": "error", | ||
"jest/prefer-to-have-length": "off", | ||
"jest/valid-expect": "error", | ||
"@typescript-eslint/no-non-null-assertion": "off", | ||
// Tons of violations in the codebase | ||
"@typescript-eslint/naming-convention": "off", | ||
// Used liberally in the codebase | ||
"@typescript-eslint/no-explicit-any": "off", | ||
// This has value in communicating with other Developers even if it has no functional effect. | ||
"@typescript-eslint/no-empty-interface": "off", | ||
}, | ||
} |
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
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
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
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
Oops, something went wrong.