-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TypeScript] Lint TypeScipt code (#736)
Currently the typescript code is not being linted in the CI. This PR adds some basic recommended typescript linting rules and fixes to code so that the linting succeeds. In order to fix an import lint on importing `truffle-assertions`, I added some typings for the module. ### Test Plan CI - linting should succeed. ### Commit History * ignore fewer files * lint TS files
- Loading branch information
Showing
27 changed files
with
1,312 additions
and
1,436 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 |
---|---|---|
@@ -1,34 +1,41 @@ | ||
module.exports = { | ||
root: true, | ||
parser: "@typescript-eslint/parser", | ||
env: { | ||
browser: true, | ||
node: true, | ||
commonjs: true, | ||
es2020: true, | ||
}, | ||
extends: "eslint:recommended", | ||
extends: ["eslint:recommended", "plugin:@typescript-eslint/eslint-recommended", "plugin:@typescript-eslint/recommended"], | ||
parserOptions: { | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
ecmaVersion: 2015, | ||
sourceType: "module", | ||
}, | ||
plugins: ["react", "@typescript-eslint"], | ||
plugins: ["@typescript-eslint"], | ||
rules: { | ||
indent: ["error", 2], | ||
"linebreak-style": ["error", "unix"], | ||
"no-console": "error", | ||
quotes: ["error", "double"], | ||
semi: ["error", "never"], | ||
"prefer-const": ["error"], | ||
"no-var": ["error"], | ||
|
||
"no-unused-vars": "off", | ||
"@typescript-eslint/no-unused-vars": ["error"], | ||
"@typescript-eslint/camelcase": "off", | ||
"@typescript-eslint/no-use-before-define": "off", | ||
}, | ||
globals: { | ||
artifacts: false, | ||
contract: false, | ||
assert: false, | ||
web3: false, | ||
}, | ||
overrides: [ | ||
{ | ||
files: ["*.js"], | ||
rules: { | ||
"@typescript-eslint/explicit-function-return-type": "off", | ||
"@typescript-eslint/no-var-requires": "off", | ||
}, | ||
}, | ||
], | ||
ignorePatterns: ["build/", "coverage/", "node_modules/"], | ||
} |
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 |
---|---|---|
|
@@ -2,8 +2,4 @@ module.exports = { | |
rules: { | ||
"no-console": "off", | ||
}, | ||
env: { | ||
mocha: true, | ||
node: true, | ||
}, | ||
} |
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.