Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1205 from danger/fb/eslint
chore: Switch from tslint to eslint
- Loading branch information
Showing
51 changed files
with
708 additions
and
163 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
Oops, something went wrong.