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

Update linting #3539

Merged
merged 16 commits into from
Jul 25, 2024
  •  
  •  
  •  
5 changes: 2 additions & 3 deletions config/eslint.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ module.exports = {
'benchmarks',
'coverage',
'dist',
'examples',
'node_modules',
'prettier.config.js',
'recipes',
Expand Down Expand Up @@ -116,11 +115,11 @@ module.exports = {
parserOptions: {
extraFileExtensions: ['.json'],
sourceType: 'module',
project: './tsconfig.json',
project: './tsconfig.lint.json',
},
overrides: [
{
files: ['test/**/*.ts', 'tests/**/*.ts'],
files: ['test/**/*.ts', 'tests/**/*.ts', 'examples/**/*.ts'],
rules: {
'implicit-dependencies/no-implicit': 'off',
'import/no-extraneous-dependencies': 'off',
Expand Down
135 changes: 53 additions & 82 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,20 @@
"@vitest/ui": "^v2.0.0-beta.12",
"c8": "7.12.0",
"embedme": "1.22.1",
"eslint": "8.45.0",
"eslint-config-prettier": "8.8.0",
"eslint-config-typestrict": "1.0.5",
"eslint": "8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-config-typestrict": "^1.0.5",
gabrocheleau marked this conversation as resolved.
Show resolved Hide resolved
"eslint-formatter-codeframe": "7.32.1",
"eslint-plugin-ethereumjs": "file:./eslint",
"eslint-plugin-github": "4.9.2",
"eslint-plugin-implicit-dependencies": "1.1.1",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-simple-import-sort": "7.0.0",
"eslint-plugin-sonarjs": "0.19.0",
"lint-staged": "13.0.3",
"lockfile-lint-api": "^5.5.1",
"prettier": "2.7.1",
"prettier": "^3.3.3",
"sort-package-json": "1.57.0",
"tape": "5.6.0",
"tsx": "^4.6.2",
Expand Down
16 changes: 15 additions & 1 deletion packages/block/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
module.exports = require('../../config/eslint.cjs')
module.exports = {
extends: '../../config/eslint.cjs',
parserOptions: {
project: ['./tsconfig.lint.json'],
},
overrides: [
{
files: ['examples/**/*'],
rules: {
'no-console': 'off',
'@typescript-eslint/no-unused-vars': 'off',
},
},
gabrocheleau marked this conversation as resolved.
Show resolved Hide resolved
],
}
6 changes: 3 additions & 3 deletions packages/block/examples/1559.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Block, createBlockFromBlockData } from '@ethereumjs/block'
import { createBlockFromBlockData } from '@ethereumjs/block'
import { Chain, Common, Hardfork } from '@ethereumjs/common'
const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.London })

Expand All @@ -10,7 +10,7 @@ const block = createBlockFromBlockData(
gasUsed: BigInt(60),
},
},
{ common }
{ common },
)

// Base fee will increase for next block since the
Expand All @@ -27,7 +27,7 @@ const blockWithMatchingBaseFee = createBlockFromBlockData(
gasUsed: BigInt(60),
},
},
{ common }
{ common },
)

console.log(Number(blockWithMatchingBaseFee.header.baseFeePerGas)) // 11
8 changes: 4 additions & 4 deletions packages/block/examples/4844.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const main = async () => {
})
const blobTx = create4844BlobTx(
{ blobsData: ['myFirstBlob'], to: Address.fromPrivateKey(randomBytes(32)) },
{ common }
{ common },
)

const block = createBlockFromBlockData(
Expand All @@ -30,14 +30,14 @@ const main = async () => {
{
common,
skipConsensusFormatValidation: true,
}
},
)

console.log(
`4844 block header with excessBlobGas=${block.header.excessBlobGas} created and ${
block.transactions.filter((tx) => tx.type === 3).length
} blob transactions`
} blob transactions`,
)
}

main()
void main()
2 changes: 1 addition & 1 deletion packages/block/examples/clique.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Block, createBlockFromBlockData } from '@ethereumjs/block'
import { createBlockFromBlockData } from '@ethereumjs/block'
import { Chain, Common, Hardfork } from '@ethereumjs/common'

const common = new Common({ chain: Chain.Goerli, hardfork: Hardfork.Chainstart })
Expand Down
4 changes: 2 additions & 2 deletions packages/block/examples/pos.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Block, createBlockFromBlockData } from '@ethereumjs/block'
import { createBlockFromBlockData } from '@ethereumjs/block'
import { Chain, Common } from '@ethereumjs/common'

const common = new Common({ chain: Chain.Mainnet })
Expand All @@ -7,7 +7,7 @@ const block = createBlockFromBlockData(
{
// Provide your block data here or use default values
},
{ common }
{ common },
)

console.log(`Proof-of-Stake (default) block created with hardfork=${block.common.hardfork()}`)
2 changes: 1 addition & 1 deletion packages/block/examples/pow.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Block, createBlockFromBlockData } from '@ethereumjs/block'
import { createBlockFromBlockData } from '@ethereumjs/block'
import { Chain, Common, Hardfork } from '@ethereumjs/common'

const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Chainstart })
Expand Down
Loading
Loading