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