Skip to content

Commit

Permalink
fix: add more linting
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDZhon committed Nov 20, 2024
1 parent 9731d14 commit db1218a
Show file tree
Hide file tree
Showing 7 changed files with 123 additions and 1 deletion.
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yarn commitlint --edit ${1}
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yarn lint-staged
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.gitignore
.prettierignore

eslint.config.mjs

yarn.json
18 changes: 18 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"semi": true,
"singleQuote": false,
"printWidth": 120,
"tabWidth": 2,
"quoteProps": "consistent",
"plugins": ["prettier-plugin-solidity"],
"overrides": [
{
"files": "*.sol",
"options": {
"parser": "solidity-parse",
"tabWidth": 4,
"useTabs": false
}
}
]
}
Binary file added assets/logo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
61 changes: 61 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// @ts-check
import path from "node:path";
import { fileURLToPath } from "node:url";
import { includeIgnoreFile } from "@eslint/compat";
import js from "@eslint/js";
import ts from "typescript-eslint";
import prettier from "eslint-config-prettier";

import pluginNoOnlyTests from "eslint-plugin-no-only-tests";
import pluginSimpleImportSort from "eslint-plugin-simple-import-sort";
import globals from "globals";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const gitignorePath = path.resolve(__dirname, ".gitignore");

export default [
includeIgnoreFile(gitignorePath),
{
ignores: [".solcover.js", "eslint.config.mjs"],
},
js.configs.recommended,
...ts.configs.recommended,
prettier,
{
languageOptions: {
parserOptions: {
ecmaVersion: 2022, sourceType: "module", project: ["./tsconfig.json"],
},
},
plugins: {
"no-only-tests": pluginNoOnlyTests,
"simple-import-sort": pluginSimpleImportSort,
},
rules: {
"@typescript-eslint/no-explicit-any": ["warn"],
"@typescript-eslint/no-unused-vars": ["warn"],
"@typescript-eslint/no-floating-promises": ["warn"],
"@typescript-eslint/no-shadow": ["error"], // prevents committing `describe.only` and `it.only` tests
"no-only-tests/no-only-tests": "warn",
"no-shadow": "off",
"simple-import-sort/imports": ["error", {
"groups": [["^node:"], ["^\\u0000"], ["^[^@]\\w"], ["^@\\w"], ["^typechain-types"], ["^lib"], ["^test"], ["^../"], ["^./"], ["^"]],
}],
},
},
{
files: [
"**/*.ts",
],
languageOptions: {
globals: {
...globals.mocha,
...globals.chai,
},
},
rules: {
"@typescript-eslint/no-unused-expressions": ["off"],
},
},
];
37 changes: 36 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,30 @@
{
"name": "multichain-automaton",
"version": "0.0.1",
"description": "Multichain Automation for stETH and wstETH bridge deployments on OP-stack compatible networks",
"license": "MIT",
"engines": {
"node": ">=20"
},
"packageManager": "[email protected]",
"scripts": {
"lint:ts": "eslint . --max-warnings=0",
"lint:ts:fix": "yarn lint:ts --fix",
"lint": "yarn lint:ts",
"format": "prettier . --write",
"typecheck": "tsc --noEmit",
"prepare": "husky",
"start": "ts-node src/deploy.ts",
"postinstall": "cd diffyscan && yarn && poetry install && cd ../lido-l2-with-steth && npm install && npm run compile && cd ../state-mate && yarn && cd ../governance-crosschain-bridges && npm install && npm run compile && cd .. && mkdir -p artifacts"
},
"lint-staged": {
"./**/*.ts": [
"eslint --max-warnings=0"
],
"./**/*.{ts,md,json}": [
"prettier --write"
]
},
"dependencies": {
"chalk": "^4.1.2",
"commander": "^12.1.0",
Expand All @@ -14,10 +34,25 @@
"yaml": "^2.6.0"
},
"devDependencies": {
"husky": "^9.1.6",
"lint-staged": "^15.2.10",
"prettier": "^3.3.3",
"@types/node": "^22.7.8",
"hardhat": "^2.22.14",
"hardhat-deploy": "^0.14.0",
"hardhat-tracer": "3.1.0",
"hardhat-watcher": "2.5.0",
"ts-node": "^10.9.2",
"typescript": "^5.6.3"
"typescript": "^5.6.3",
"typescript-eslint": "^8.7.0",
"@commitlint/cli": "^19.5.0",
"@commitlint/config-conventional": "^19.5.0",
"@eslint/compat": "^1.1.1",
"@eslint/js": "^9.11.1",
"eslint": "^9.11.1",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-no-only-tests": "^3.3.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-simple-import-sort": "12.1.1"
}
}

0 comments on commit db1218a

Please sign in to comment.