diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 000000000..684857fd9 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,7 @@ +.yarn +artifacts +cache +dist +node_modules +pkg +typechain-types diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 000000000..55010a441 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,51 @@ +const path = require("path"); + +const OFF = 0; + +/** + * @type {import("eslint").Linter.Config} + */ +module.exports = { + env: { + browser: false, + es2021: true, + mocha: true, + node: true, + }, + extends: ["plugin:prettier/recommended"], + parser: "@typescript-eslint/parser", + parserOptions: { + ecmaVersion: 12, + }, + plugins: [ + "@typescript-eslint", + "prettier", + "simple-import-sort", + "sort-keys-fix", + "typescript-sort-keys", + ], + rules: { + "@typescript-eslint/sort-type-union-intersection-members": "error", + camelcase: "off", + "no-console": OFF, + "simple-import-sort/exports": "error", + "simple-import-sort/imports": "error", + "sort-keys-fix/sort-keys-fix": "error", + "typescript-sort-keys/interface": "error", + "typescript-sort-keys/string-enum": "error", + }, + settings: { + "import/parsers": { + "@typescript-eslint/parser": [".js", ".jsx", ".ts", ".tsx", ".d.ts"], + }, + "import/resolver": { + node: { + extensions: [".js", ".jsx", ".ts", ".tsx", ".d.ts"], + }, + typescript: { + project: path.join(__dirname, "tsconfig.json"), + }, + }, + }, +}; + diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 000000000..834033267 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,6 @@ +.yarn +artifacts +cache +coverage* +gasReporterOutput.json +node_modules diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 000000000..963354f23 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,3 @@ +{ + "printWidth": 120 +} diff --git a/.solhint.json b/.solhint.json new file mode 100644 index 000000000..5dc695391 --- /dev/null +++ b/.solhint.json @@ -0,0 +1,10 @@ +{ + "extends": "solhint:recommended", + "rules": { + "compiler-version": ["error", "0.8.7"], + "func-visibility": ["warn", { "ignoreConstructors": true }], + "reason-string": ["warn", { "maxLength": 80 }], + "no-empty-blocks": "off", + "check-send-result": "off" + } +}