-
Notifications
You must be signed in to change notification settings - Fork 375
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 eslint for typescript (#10900)
* replace tslint with eslint for typescript * remove many unneeded awaits and asyncs * change console logs to console info * ignore some more offensive files * fix some interprolated values which could have been [object object] * add missing dependencies * try to have minimal changes * use tsconfig/recommended instead of our tsconfig library as base. Fix env tests use of typescript 4.0 for protocol package cannot extend because of bug in ts-node so instead just copy the config. remove tslint.json files * fix lint again * dont add strict mode, its too brutal, * add package validation * help out future devs with instructions on how to fix error * it works on my machine ok * trust but verify. but dont actually trust * use latest ts-node AND always run yarn ts-node to ensure the project one is used. * removing patch-package since the only remaining place it was used was had been for tslint * most of us dont need to decrypt to dont try automatically * i think running in yarn added extra output that broke gh action so try this otherwise revert * structs fro sol contracts are returned as objects with named keys (as well as number keys) but NOT as arrays.
- Loading branch information
Showing
139 changed files
with
917 additions
and
1,147 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,280 @@ | ||
/* | ||
👋 Hi! This file was autogenerated by tslint-to-eslint-config. | ||
https://github.com/typescript-eslint/tslint-to-eslint-config | ||
It represents the closest reasonable ESLint configuration to this | ||
project's original TSLint configuration. | ||
We recommend eventually switching this configuration to extend from | ||
the recommended rulesets in typescript-eslint. | ||
https://github.com/typescript-eslint/tslint-to-eslint-config/blob/master/docs/FAQs.md | ||
Happy linting! 💖 | ||
*/ | ||
module.exports = { | ||
env: { | ||
es6: true, | ||
node: true, | ||
}, | ||
ignorePatterns: [ | ||
'**/node_modules/**', | ||
'**/coverage/**', | ||
'**/build/**', | ||
'**/dist/**', | ||
'**/lib/**', | ||
'**/*.js', | ||
'packages/protocol/build/**', | ||
'packages/protocol/types/**', | ||
'/packages/protocol/migrations_ts/**', | ||
'packages/protocol/scripts/truffle/**', | ||
// ignoring any files that for which "TSConfig does not include this file" error was given | ||
'packages/protocol/scripts/utils.test.ts', | ||
'packages/protocol/test', | ||
'packages/protocol/truffle-config.js', | ||
'packages/protocol/truffle-config0.8.js', | ||
'packages/protocol/truffle-config-parent.js', | ||
'packages/protocol/abis', | ||
'packages/protocol/wagmi.config.ts', | ||
'**/jest.config.js', | ||
], | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:@typescript-eslint/recommended-type-checked', | ||
], | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
tsconfigRootDir: `${__dirname}`, | ||
project: ['./packages/*/tsconfig.json'], | ||
sourceType: 'module', | ||
}, | ||
plugins: ['eslint-plugin-import', '@typescript-eslint'], | ||
root: true, | ||
rules: { | ||
'@typescript-eslint/no-unused-vars': [ | ||
'error', | ||
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' }, | ||
], | ||
// i dont trust this rule | ||
'@typescript-eslint/no-unnecessary-type-assertion': 'off', | ||
'@typescript-eslint/no-misused-promises': 'off', | ||
'@typescript-eslint/adjacent-overload-signatures': 'error', | ||
'@typescript-eslint/array-type': [ | ||
'error', | ||
{ | ||
default: 'array', | ||
}, | ||
], | ||
'@typescript-eslint/ban-types': [ | ||
'error', | ||
{ | ||
types: { | ||
Object: { | ||
message: 'Avoid using the `Object` type. Did you mean `object`?', | ||
}, | ||
Function: { | ||
message: | ||
'Avoid using the `Function` type. Prefer a specific function type, like `() => void`.', | ||
}, | ||
Boolean: { | ||
message: 'Avoid using the `Boolean` type. Did you mean `boolean`?', | ||
}, | ||
Number: { | ||
message: 'Avoid using the `Number` type. Did you mean `number`?', | ||
}, | ||
String: { | ||
message: 'Avoid using the `String` type. Did you mean `string`?', | ||
}, | ||
Symbol: { | ||
message: 'Avoid using the `Symbol` type. Did you mean `symbol`?', | ||
}, | ||
}, | ||
}, | ||
], | ||
'@typescript-eslint/consistent-type-assertions': 'error', | ||
'@typescript-eslint/dot-notation': 'error', | ||
'@typescript-eslint/explicit-function-return-type': 'off', | ||
'@typescript-eslint/explicit-member-accessibility': [ | ||
'off', | ||
{ | ||
accessibility: 'explicit', | ||
}, | ||
], | ||
'@typescript-eslint/explicit-module-boundary-types': 'off', | ||
'@typescript-eslint/indent': 'off', | ||
'@typescript-eslint/member-delimiter-style': [ | ||
'off', | ||
{ | ||
multiline: { | ||
delimiter: 'none', | ||
requireLast: true, | ||
}, | ||
singleline: { | ||
delimiter: 'semi', | ||
requireLast: false, | ||
}, | ||
}, | ||
], | ||
'@typescript-eslint/naming-convention': [ | ||
'off', | ||
{ | ||
selector: 'variable', | ||
format: ['camelCase', 'UPPER_CASE'], | ||
leadingUnderscore: 'forbid', | ||
trailingUnderscore: 'forbid', | ||
}, | ||
], | ||
'@typescript-eslint/no-empty-function': 'error', | ||
'@typescript-eslint/no-empty-interface': 'error', | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'@typescript-eslint/no-floating-promises': 'error', | ||
'@typescript-eslint/no-misused-new': 'error', | ||
'@typescript-eslint/no-namespace': 'error', | ||
'@typescript-eslint/no-parameter-properties': 'off', | ||
'@typescript-eslint/no-shadow': [ | ||
'error', | ||
{ | ||
hoist: 'all', | ||
}, | ||
], | ||
'@typescript-eslint/no-this-alias': 'error', | ||
'@typescript-eslint/no-unused-expressions': 'error', | ||
'@typescript-eslint/no-unsafe-assignment': 'off', | ||
'@typescript-eslint/no-unsafe-call': 'off', | ||
'@typescript-eslint/no-unsafe-member-access': 'off', | ||
'@typescript-eslint/no-use-before-define': 'off', | ||
'@typescript-eslint/no-var-requires': 'off', | ||
'@typescript-eslint/prefer-for-of': 'error', | ||
'@typescript-eslint/prefer-function-type': 'error', | ||
'@typescript-eslint/prefer-namespace-keyword': 'error', | ||
'@typescript-eslint/quotes': 'off', | ||
'@typescript-eslint/semi': ['off', null], | ||
'@typescript-eslint/triple-slash-reference': [ | ||
'error', | ||
{ | ||
path: 'always', | ||
types: 'prefer-import', | ||
lib: 'always', | ||
}, | ||
], | ||
'@typescript-eslint/type-annotation-spacing': 'off', | ||
'@typescript-eslint/typedef': 'off', | ||
'@typescript-eslint/unified-signatures': 'error', | ||
'arrow-parens': ['off', 'always'], | ||
'brace-style': ['off', 'off'], | ||
'comma-dangle': 'off', | ||
complexity: 'off', | ||
'constructor-super': 'error', | ||
'dot-notation': 'off', | ||
'eol-last': 'off', | ||
eqeqeq: ['error', 'smart'], | ||
'guard-for-in': 'error', | ||
'id-denylist': 'error', | ||
'id-match': 'error', | ||
'import/no-extraneous-dependencies': [ | ||
'error', | ||
{ | ||
devDependencies: false, | ||
}, | ||
], | ||
'import/no-internal-modules': 'off', | ||
indent: 'off', | ||
'linebreak-style': 'off', | ||
'max-classes-per-file': ['error', 1], | ||
'max-len': 'off', | ||
'new-parens': 'off', | ||
'newline-per-chained-call': 'off', | ||
'no-bitwise': 'error', | ||
'no-caller': 'error', | ||
'no-cond-assign': 'error', | ||
'no-console': [ | ||
'error', | ||
{ | ||
allow: [ | ||
'warn', | ||
'dir', | ||
'time', | ||
'timeEnd', | ||
'timeLog', | ||
'trace', | ||
'assert', | ||
'clear', | ||
'count', | ||
'countReset', | ||
'group', | ||
'groupEnd', | ||
'table', | ||
'debug', | ||
'info', | ||
'dirxml', | ||
'error', | ||
'groupCollapsed', | ||
'Console', | ||
'profile', | ||
'profileEnd', | ||
'timeStamp', | ||
'context', | ||
], | ||
}, | ||
], | ||
'no-constant-condition': 'error', | ||
'no-debugger': 'error', | ||
'no-duplicate-case': 'error', | ||
'no-duplicate-imports': 'error', | ||
'no-empty': 'error', | ||
'no-empty-function': 'off', | ||
'no-eval': 'error', | ||
'no-extra-bind': 'error', | ||
'no-extra-semi': 'off', | ||
'no-fallthrough': 'off', | ||
'no-invalid-this': 'off', | ||
'no-irregular-whitespace': 'off', | ||
'no-multiple-empty-lines': 'off', | ||
'no-new-func': 'error', | ||
'no-new-wrappers': 'error', | ||
'no-redeclare': 'error', | ||
'no-restricted-syntax': ['error', 'ForInStatement'], | ||
'no-return-await': 'error', | ||
'no-sequences': 'error', | ||
'no-shadow': 'off', | ||
'no-sparse-arrays': 'error', | ||
'no-template-curly-in-string': 'error', | ||
'no-throw-literal': 'error', | ||
'no-trailing-spaces': 'off', | ||
'no-undef-init': 'error', | ||
'no-underscore-dangle': 'error', | ||
'no-unsafe-finally': 'error', | ||
'no-unused-expressions': 'off', | ||
'no-unused-labels': 'error', | ||
'no-use-before-define': 'off', | ||
'no-var': 'error', | ||
'object-shorthand': 'error', | ||
'one-var': ['off', 'never'], | ||
'padded-blocks': [ | ||
'off', | ||
{ | ||
blocks: 'never', | ||
}, | ||
{ | ||
allowSingleLineBlocks: true, | ||
}, | ||
], | ||
'prefer-const': 'error', | ||
'prefer-object-spread': 'error', | ||
'quote-props': 'off', | ||
quotes: 'off', | ||
radix: 'error', | ||
semi: 'off', | ||
'space-before-function-paren': 'off', | ||
'space-in-parens': ['off', 'never'], | ||
'spaced-comment': [ | ||
'error', | ||
'always', | ||
{ | ||
markers: ['/'], | ||
}, | ||
], | ||
'use-isnan': 'error', | ||
'valid-typeof': '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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports = { | ||
rules: { | ||
'no-underscore-dangle': 'off', | ||
'@typescript-eslint/no-unsafe-argument': 'off', | ||
'@typescript-eslint/no-unsafe-return': 'off', | ||
'no-bitwise': '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
Oops, something went wrong.