diff --git a/.lintstagedrc.json b/.lintstagedrc.json index 37aa61987..d2cc6a5d2 100644 --- a/.lintstagedrc.json +++ b/.lintstagedrc.json @@ -1,5 +1,5 @@ { - "*.js": "eslint --cache --fix", + "*.{js,jsx,ts,tsx}": "prettier --write", "*.{md,html,json}": "prettier --write", "*.sol": [ "prettier --write", diff --git a/.vscode/settings.json b/.vscode/settings.json index e4d0c9291..4e9360eaf 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,9 +1,12 @@ { "solidity.compileUsingRemoteVersion": "v0.8.10+commit.fc410830", - "mochaExplorer.files": "contracts/test/**/*.{j,t}s", "cSpell.words": [ "arbitrum", "IERC", - "kleros" - ] + "kleros", + "typechain" + ], + "prettier.configPath": ".prettierrc.json", + "eslint.alwaysShowStatus": true, + "eslint.packageManager": "yarn" } diff --git a/contracts/.eslintrc.js b/contracts/.eslintrc.js index 3eed39f9a..45dd3eb11 100644 --- a/contracts/.eslintrc.js +++ b/contracts/.eslintrc.js @@ -6,12 +6,23 @@ module.exports = { node: true, }, plugins: ["@typescript-eslint"], - extends: ["standard", "plugin:prettier/recommended", "plugin:node/recommended"], + extends: ["standard", "plugin:prettier/recommended", "plugin:node/recommended", "plugin:import/typescript"], parser: "@typescript-eslint/parser", parserOptions: { ecmaVersion: 12, }, rules: { - "node/no-unsupported-features/es-syntax": ["error", { ignores: ["modules"] }], + "node/no-unsupported-features/es-syntax": [ + "error", + { + ignores: ["modules"], + }, + ], + "node/no-missing-import": [ + "error", + { + tryExtensions: [".js", ".ts", ".json", ".node"], + }, + ], }, }; diff --git a/contracts/tsconfig.json b/contracts/tsconfig.json index 89fda3d84..dffa3bb53 100644 --- a/contracts/tsconfig.json +++ b/contracts/tsconfig.json @@ -13,7 +13,7 @@ "./src", "./scripts", "./test", - "./typechain", + "./typechain-types", "./deploy" ], "files": [ diff --git a/package.json b/package.json index 384a3563e..27746c6da 100644 --- a/package.json +++ b/package.json @@ -36,10 +36,8 @@ "eslint-utils": "^3.0.0", "husky": "^7.0.0", "lint-staged": "^11.0.0", - "npm-run-all": "^4.1.5", "prettier": "^2.4.1", "prettier-plugin-solidity": "^1.0.0-beta.15", - "solhint": "^3.3.6", "solhint-plugin-prettier": "^0.0.5" }, "resolutions": { @@ -69,13 +67,6 @@ "scripts": { "depcheck": "depcheck .", "changelog": "conventional-changelog --infile CHANGELOG.md --same-file --release-count 0 && prettier --write CHANGELOG.md", - "lint": "run-p -s lint:*", - "lint:js": "eslint .", - "lint:sol": "solhint 'contracts/**/*.sol'", - "fix": "run-p -s fix:*", - "fix:js": "eslint --fix '**/*.js'", - "fix:sol": "prettier --write 'contracts/**/*.sol'", - "prepare": "husky install", "postinstall": "husky install" } } diff --git a/yarn.lock b/yarn.lock index 40f28c5f2..d48a83865 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14088,10 +14088,8 @@ __metadata: eslint-utils: ^3.0.0 husky: ^7.0.0 lint-staged: ^11.0.0 - npm-run-all: ^4.1.5 prettier: ^2.4.1 prettier-plugin-solidity: ^1.0.0-beta.15 - solhint: ^3.3.6 solhint-plugin-prettier: ^0.0.5 languageName: unknown linkType: soft @@ -19839,7 +19837,7 @@ __metadata: languageName: node linkType: hard -"solhint@npm:^3.3.6, solhint@npm:^3.3.7": +"solhint@npm:^3.3.7": version: 3.3.7 resolution: "solhint@npm:3.3.7" dependencies: