Skip to content

Commit

Permalink
chore: update eslint config
Browse files Browse the repository at this point in the history
  • Loading branch information
lingcoder committed Aug 8, 2024
1 parent 55e9465 commit 6a1f047
Show file tree
Hide file tree
Showing 5 changed files with 163 additions and 69 deletions.
9 changes: 0 additions & 9 deletions .eslintignore

This file was deleted.

60 changes: 0 additions & 60 deletions .eslintrc

This file was deleted.

105 changes: 105 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
// eslint-disable-next-line strict
import mocha from "eslint-plugin-mocha";
import globals from "globals";
import tsParser from "@typescript-eslint/parser";
import path from "node:path";
import {fileURLToPath} from "node:url";
import js from "@eslint/js";
import {FlatCompat} from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});

export default [{
ignores: [
"**/node_modules",
"**/.eslintrc*",
"**/artifacts",
"**/cache",
"**/constants",
"**/coverage",
"lib/murky",
"lib/openzeppelin-contracts",
"typechain-types/*",
],
}, ...compat.extends("standard"), {
plugins: {
mocha,
},

languageOptions: {
globals: {
...globals.browser,
...globals.node,
...globals.mocha,
...globals.jest,
artifacts: false,
contract: false,
assert: false,
web3: false,
usePlugin: false,
extendEnvironment: false,
},

parser: tsParser,
ecmaVersion: 2020,
sourceType: "commonjs",
},

rules: {
strict: ["error", "global"],
"array-bracket-spacing": ["off"],

camelcase: ["error", {
properties: "always",
}],

"comma-dangle": ["error", "always-multiline"],

"comma-spacing": ["error", {
before: false,
after: true,
}],

"dot-notation": ["error", {
allowKeywords: true,
allowPattern: "",
}],

"eol-last": ["error", "always"],
eqeqeq: ["error", "smart"],
"generator-star-spacing": ["error", "before"],
indent: ["error", 2],
"linebreak-style": ["error", "unix"],
"max-len": ["error", 120, 2],
"no-debugger": "off",
"no-dupe-args": "error",
"no-dupe-keys": "error",
"no-mixed-spaces-and-tabs": ["error", "smart-tabs"],

"no-redeclare": ["error", {
builtinGlobals: true,
}],

"no-trailing-spaces": ["error", {
skipBlankLines: false,
}],

"no-undef": "error",
"no-use-before-define": "off",
"no-var": "error",
"object-curly-spacing": "off",
"prefer-const": "error",
quotes: "off",
semi: ["error", "always"],
"space-before-function-paren": "off",
"mocha/no-exclusive-tests": ["error"],
"promise/always-return": "off",
"promise/avoid-new": "off",
},
}];
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
"devDependencies": {
"@commitlint/cli": "^19.4.0",
"@commitlint/config-conventional": "^19.2.2",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.8.0",
"@metamask/eth-sig-util": "^7.0.3",
"@nomicfoundation/hardhat-chai-matchers": "^2.0.7",
"@nomicfoundation/hardhat-ethers": "^3.0.6",
Expand Down Expand Up @@ -52,6 +54,7 @@
"eslint-plugin-promise": "^6.6.0",
"ethers": "^6.13.2",
"fs-extra": "^11.2.0",
"globals": "^15.9.0",
"hardhat": "^2.22.8",
"hardhat-abi-exporter": "^2.10.1",
"hardhat-contract-sizer": "^2.10.0",
Expand Down
55 changes: 55 additions & 0 deletions pnpm-lock.yaml

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

0 comments on commit 6a1f047

Please sign in to comment.