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

Handling the "unnecessary await" linter warning #1177

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
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
12 changes: 12 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,17 @@ engines:
checks:
quotemark:
enabled: false
eslint:
enabled: true
config:
config:
- web/.eslintrc.json
- eslint-config/.eslintrc.js
extensions:
- .es6
- .js
- .jsx
- .mjs
- .vue
exclude_paths:
- "web/src/graphql/generated.ts"
23 changes: 17 additions & 6 deletions eslint-config/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,23 @@ module.exports = {
mocha: true,
es2020: true,
},
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"plugin:import/recommended",
],
extends: ["eslint:recommended", "plugin:prettier/recommended", "plugin:import/recommended"],
plugins: ["@typescript-eslint", "prettier", "import"],
overrides: [
{
files: ["*.ts", "*.tsx"],
extends: [
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
],
parserOptions: {
project: ["./tsconfig.json"],
},
rules: {
"@typescript-eslint/return-await": ["error", "always"],
},
},
],
rules: {
"no-unused-vars": [
"error",
Expand Down Expand Up @@ -44,5 +54,6 @@ module.exports = {
tryExtensions: [".js", ".ts", ".json", ".node"],
},
],
"no-return-await": "off",
},
};
2 changes: 1 addition & 1 deletion eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"eslint-utils": "^3.0.0"
},
"devDependencies": {
"typescript": "^4.9.5"
"@kleros/kleros-v2-tsconfig": "*"
},
"peerDependencies": {
"eslint": "8.x"
Expand Down
3 changes: 0 additions & 3 deletions tsconfig/.eslintrc

This file was deleted.

1 change: 1 addition & 0 deletions web/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/hooks/contracts/generated.ts
24 changes: 24 additions & 0 deletions web/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,29 @@
"security",
"import"
],
"overrides": [
{
"files": [
"*.ts",
"*.tsx"
],
"extends": [
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking"
],
"parserOptions": {
"project": [
"./tsconfig.json"
]
},
"rules": {
"@typescript-eslint/return-await": [
"error",
"always"
]
}
}
],
"ignorePatterns": [
"src/assets"
],
Expand Down Expand Up @@ -83,6 +106,7 @@
]
}
],
"no-return-await": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-explicit-any": "off",
"security/detect-object-injection": "off",
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5197,6 +5197,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@kleros/kleros-v2-eslint-config@workspace:eslint-config"
dependencies:
"@kleros/kleros-v2-tsconfig": "*"
"@typescript-eslint/eslint-plugin": ^5.59.11
"@typescript-eslint/parser": ^5.61.0
"@typescript-eslint/utils": ^5.59.11
Expand All @@ -5208,7 +5209,6 @@ __metadata:
eslint-plugin-promise: ^5.2.0
eslint-plugin-security: ^1.7.1
eslint-utils: ^3.0.0
typescript: ^4.9.5
peerDependencies:
eslint: 8.x
languageName: unknown
Expand Down Expand Up @@ -5236,7 +5236,7 @@ __metadata:
languageName: unknown
linkType: soft

"@kleros/kleros-v2-tsconfig@workspace:^, @kleros/kleros-v2-tsconfig@workspace:tsconfig":
"@kleros/kleros-v2-tsconfig@*, @kleros/kleros-v2-tsconfig@workspace:^, @kleros/kleros-v2-tsconfig@workspace:tsconfig":
version: 0.0.0-use.local
resolution: "@kleros/kleros-v2-tsconfig@workspace:tsconfig"
dependencies:
Expand Down
Loading