|
| 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 | + files: ["**/*.ts", "**/*.tsx"], |
| 20 | + ignores: [ |
| 21 | + "**/node_modules", |
| 22 | + "**/.eslintrc*", |
| 23 | + "**/artifacts", |
| 24 | + "**/cache", |
| 25 | + "**/constants", |
| 26 | + "**/coverage", |
| 27 | + "lib/murky", |
| 28 | + "lib/openzeppelin-contracts", |
| 29 | + "typechain-types/*", |
| 30 | + ], |
| 31 | +}, ...compat.extends("standard"), { |
| 32 | + plugins: { |
| 33 | + mocha, |
| 34 | + }, |
| 35 | + |
| 36 | + languageOptions: { |
| 37 | + globals: { |
| 38 | + ...globals.browser, |
| 39 | + ...globals.node, |
| 40 | + ...globals.mocha, |
| 41 | + ...globals.jest, |
| 42 | + artifacts: false, |
| 43 | + contract: false, |
| 44 | + assert: false, |
| 45 | + web3: false, |
| 46 | + usePlugin: false, |
| 47 | + extendEnvironment: false, |
| 48 | + }, |
| 49 | + |
| 50 | + parser: tsParser, |
| 51 | + ecmaVersion: 2020, |
| 52 | + sourceType: "commonjs", |
| 53 | + }, |
| 54 | + |
| 55 | + rules: { |
| 56 | + strict: ["error", "global"], |
| 57 | + "array-bracket-spacing": ["off"], |
| 58 | + |
| 59 | + camelcase: ["error", { |
| 60 | + properties: "always", |
| 61 | + }], |
| 62 | + |
| 63 | + "comma-dangle": ["error", "always-multiline"], |
| 64 | + |
| 65 | + "comma-spacing": ["error", { |
| 66 | + before: false, |
| 67 | + after: true, |
| 68 | + }], |
| 69 | + |
| 70 | + "dot-notation": ["error", { |
| 71 | + allowKeywords: true, |
| 72 | + allowPattern: "", |
| 73 | + }], |
| 74 | + |
| 75 | + "eol-last": ["error", "always"], |
| 76 | + eqeqeq: ["error", "smart"], |
| 77 | + "generator-star-spacing": ["error", "before"], |
| 78 | + indent: ["error", 2], |
| 79 | + "linebreak-style": ["error", "unix"], |
| 80 | + "max-len": ["error", 120, 2], |
| 81 | + "no-debugger": "off", |
| 82 | + "no-dupe-args": "error", |
| 83 | + "no-dupe-keys": "error", |
| 84 | + "no-mixed-spaces-and-tabs": ["error", "smart-tabs"], |
| 85 | + |
| 86 | + "no-redeclare": ["error", { |
| 87 | + builtinGlobals: true, |
| 88 | + }], |
| 89 | + |
| 90 | + "no-trailing-spaces": ["error", { |
| 91 | + skipBlankLines: false, |
| 92 | + }], |
| 93 | + |
| 94 | + "no-undef": "error", |
| 95 | + "no-use-before-define": "off", |
| 96 | + "no-var": "error", |
| 97 | + "object-curly-spacing": "off", |
| 98 | + "prefer-const": "error", |
| 99 | + quotes: "off", |
| 100 | + semi: ["error", "always"], |
| 101 | + "space-before-function-paren": "off", |
| 102 | + "mocha/no-exclusive-tests": ["error"], |
| 103 | + "promise/always-return": "off", |
| 104 | + "promise/avoid-new": "off", |
| 105 | + }, |
| 106 | +}]; |
0 commit comments