Skip to content

Commit 6a1f047

Browse files
committed
chore: update eslint config
1 parent 55e9465 commit 6a1f047

File tree

5 files changed

+163
-69
lines changed

5 files changed

+163
-69
lines changed

.eslintignore

-9
This file was deleted.

.eslintrc

-60
This file was deleted.

eslint.config.mjs

+105
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
// eslint-disable-next-line strict
2+
import mocha from "eslint-plugin-mocha";
3+
import globals from "globals";
4+
import tsParser from "@typescript-eslint/parser";
5+
import path from "node:path";
6+
import {fileURLToPath} from "node:url";
7+
import js from "@eslint/js";
8+
import {FlatCompat} from "@eslint/eslintrc";
9+
10+
const __filename = fileURLToPath(import.meta.url);
11+
const __dirname = path.dirname(__filename);
12+
const compat = new FlatCompat({
13+
baseDirectory: __dirname,
14+
recommendedConfig: js.configs.recommended,
15+
allConfig: js.configs.all,
16+
});
17+
18+
export default [{
19+
ignores: [
20+
"**/node_modules",
21+
"**/.eslintrc*",
22+
"**/artifacts",
23+
"**/cache",
24+
"**/constants",
25+
"**/coverage",
26+
"lib/murky",
27+
"lib/openzeppelin-contracts",
28+
"typechain-types/*",
29+
],
30+
}, ...compat.extends("standard"), {
31+
plugins: {
32+
mocha,
33+
},
34+
35+
languageOptions: {
36+
globals: {
37+
...globals.browser,
38+
...globals.node,
39+
...globals.mocha,
40+
...globals.jest,
41+
artifacts: false,
42+
contract: false,
43+
assert: false,
44+
web3: false,
45+
usePlugin: false,
46+
extendEnvironment: false,
47+
},
48+
49+
parser: tsParser,
50+
ecmaVersion: 2020,
51+
sourceType: "commonjs",
52+
},
53+
54+
rules: {
55+
strict: ["error", "global"],
56+
"array-bracket-spacing": ["off"],
57+
58+
camelcase: ["error", {
59+
properties: "always",
60+
}],
61+
62+
"comma-dangle": ["error", "always-multiline"],
63+
64+
"comma-spacing": ["error", {
65+
before: false,
66+
after: true,
67+
}],
68+
69+
"dot-notation": ["error", {
70+
allowKeywords: true,
71+
allowPattern: "",
72+
}],
73+
74+
"eol-last": ["error", "always"],
75+
eqeqeq: ["error", "smart"],
76+
"generator-star-spacing": ["error", "before"],
77+
indent: ["error", 2],
78+
"linebreak-style": ["error", "unix"],
79+
"max-len": ["error", 120, 2],
80+
"no-debugger": "off",
81+
"no-dupe-args": "error",
82+
"no-dupe-keys": "error",
83+
"no-mixed-spaces-and-tabs": ["error", "smart-tabs"],
84+
85+
"no-redeclare": ["error", {
86+
builtinGlobals: true,
87+
}],
88+
89+
"no-trailing-spaces": ["error", {
90+
skipBlankLines: false,
91+
}],
92+
93+
"no-undef": "error",
94+
"no-use-before-define": "off",
95+
"no-var": "error",
96+
"object-curly-spacing": "off",
97+
"prefer-const": "error",
98+
quotes: "off",
99+
semi: ["error", "always"],
100+
"space-before-function-paren": "off",
101+
"mocha/no-exclusive-tests": ["error"],
102+
"promise/always-return": "off",
103+
"promise/avoid-new": "off",
104+
},
105+
}];

package.json

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
"devDependencies": {
2323
"@commitlint/cli": "^19.4.0",
2424
"@commitlint/config-conventional": "^19.2.2",
25+
"@eslint/eslintrc": "^3.1.0",
26+
"@eslint/js": "^9.8.0",
2527
"@metamask/eth-sig-util": "^7.0.3",
2628
"@nomicfoundation/hardhat-chai-matchers": "^2.0.7",
2729
"@nomicfoundation/hardhat-ethers": "^3.0.6",
@@ -52,6 +54,7 @@
5254
"eslint-plugin-promise": "^6.6.0",
5355
"ethers": "^6.13.2",
5456
"fs-extra": "^11.2.0",
57+
"globals": "^15.9.0",
5558
"hardhat": "^2.22.8",
5659
"hardhat-abi-exporter": "^2.10.1",
5760
"hardhat-contract-sizer": "^2.10.0",

pnpm-lock.yaml

+55
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)