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

Global eslint and prettier config #30

Closed
wants to merge 12 commits into from
6 changes: 6 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules/
.cache/
cache/
public/
build/
typechain/
File renamed without changes.
1 change: 1 addition & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
c78b15d93f74d1f32b262d86848b4a9b1e43a4d4
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
yarn-debug.log*
yarn-error.log*
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ repos:
hooks:
- id: lint-sol
name: "lint core sol"
entry: /usr/bin/env bash -c "cd core/ && npm run lint:sol"
entry: /usr/bin/env bash -c "echo `lint sol`"
files: '\.sol$'
language: script
description: "Checks solidity code according to the package's linter configuration"
- id: lint-js
name: "lint core ts/js"
entry: /usr/bin/env bash -c "cd core/ && npm run lint:js"
entry: /usr/bin/env bash -c "echo `lint js/ts`"
files: '\.(ts|js)$'
language: script
description: "Checks TS/JS code according to the package's linter configuration"
- id: lint-config
name: "lint core json/yaml"
entry: /usr/bin/env bash -c "cd core/ && npm run lint:config"
entry: /usr/bin/env bash -c "echo `lint config`"
files: '\.(json|yaml)$'
language: script
description: "Checks JSON/YAML code according to the package's linter configuration"
2 changes: 2 additions & 0 deletions core/.prettierignore → .prettierignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
build/
cache/
.cache/
public/
deployments/
export.json
export/
Expand Down
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions .solhintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
File renamed without changes.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"eslint.workingDirectories": [{ "mode": "auto" }]
"eslint.workingDirectories": ["./"]
}
6 changes: 0 additions & 6 deletions core/.eslintignore

This file was deleted.

17 changes: 10 additions & 7 deletions core/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
{
"root": true,
"extends": ["@thesis-co"],
"rules": {
"import/no-extraneous-dependencies": [
"error",
{ "devDependencies": ["hardhat.config.ts", "test/**"] }
]
}
"extends":["../.eslintrc"],
"overrides": [
{
"files": ["hardhat.config.ts", "test/**"],
"rules": {
"semi": "error",
"import/no-extraneous-dependencies": "off"
}
Comment on lines +7 to +10
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we keep the rules we had defined in the previous version?

}
]
}
Empty file removed core/.git-blame-ignore-revs
Empty file.
1 change: 0 additions & 1 deletion core/.solhintignore

This file was deleted.

2 changes: 1 addition & 1 deletion core/deploy/01_deploy_acre.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { HardhatRuntimeEnvironment } from "hardhat/types"
import type { DeployFunction } from "hardhat-deploy/types"

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
const { deployments } = hre
const { log } = deployments

Expand Down
14 changes: 0 additions & 14 deletions core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@
"clean": "hardhat clean && rm -rf cache/ export/ export.json",
"build": "hardhat compile",
"deploy": "hardhat deploy --export export.json",
"format": "npm run lint:js && npm run lint:sol && npm run lint:config",
"format:fix": "npm run lint:js:fix && npm run lint:sol:fix && npm run lint:config:fix",
"lint:js": "eslint .",
"lint:js:fix": "eslint . --fix",
"lint:sol": "solhint 'contracts/**/*.sol' && prettier --check 'contracts/**/*.sol'",
"lint:sol:fix": "solhint 'contracts/**/*.sol' --fix && prettier --write 'contracts/**/*.sol'",
"lint:config": "prettier --check '**/*.@(json)'",
"lint:config:fix": "prettier --write '**/*.@(json)'",
"test": "hardhat test"
},
"devDependencies": {
Expand All @@ -35,22 +27,16 @@
"@nomicfoundation/hardhat-verify": "^1.0.0",
"@nomiclabs/hardhat-etherscan": "^3.1.7",
"@openzeppelin/hardhat-upgrades": "^2.3.3",
"@thesis-co/eslint-config": "^0.6.1",
"@typechain/ethers-v6": "^0.5.1",
"@typechain/hardhat": "^9.1.0",
"@types/chai": "^4.2.0",
"@types/mocha": ">=9.1.0",
"@types/node": ">=16.0.0",
"chai": "^4.3.10",
"eslint": "^8.51.0",
"ethers": "^6.8.0",
"hardhat": "^2.18.2",
"hardhat-deploy": "^0.11.43",
"hardhat-gas-reporter": "^1.0.8",
"prettier": "^3.0.3",
"prettier-plugin-solidity": "^1.1.3",
"solhint": "^3.6.2",
"solhint-config-thesis": "github:thesis/solhint-config",
"solidity-coverage": "^0.8.0",
"ts-node": "^10.9.1",
"typechain": "^8.3.2",
Expand Down
Loading
Loading