Skip to content

Commit 27e4c43

Browse files
fix: update eslint config
1 parent 4abc193 commit 27e4c43

File tree

5 files changed

+116
-49
lines changed

5 files changed

+116
-49
lines changed

.eslintrc.json

-40
This file was deleted.

eslint.config.mjs

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
import globals from "globals";
2+
import parser from "vue-eslint-parser";
3+
import typescriptEslint from "@typescript-eslint/eslint-plugin";
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+
const config = [...compat.extends("eslint:recommended"), {
19+
languageOptions: {
20+
globals: {
21+
...globals.browser,
22+
},
23+
24+
parser: parser,
25+
ecmaVersion: 5,
26+
sourceType: "module",
27+
28+
parserOptions: {
29+
parser: "@babel/eslint-parser",
30+
allowImportExportEverywhere: false,
31+
},
32+
},
33+
34+
rules: {
35+
"func-names": 0,
36+
"no-nested-ternary": 0,
37+
"max-len": 0,
38+
"arrow-parens": ["error", "always"],
39+
"no-underscore-dangle": 0,
40+
41+
"comma-dangle": ["error", {
42+
arrays: "always-multiline",
43+
objects: "always-multiline",
44+
imports: "always-multiline",
45+
exports: "always-multiline",
46+
functions: "never",
47+
}],
48+
49+
"no-use-before-define": ["error", "nofunc"],
50+
51+
"no-empty": ["error", {
52+
allowEmptyCatch: true,
53+
}],
54+
55+
"no-mixed-operators": ["error", {
56+
allowSamePrecedence: true,
57+
}],
58+
59+
indent: ["error", 4, {
60+
flatTernaryExpressions: true,
61+
SwitchCase: 1,
62+
}],
63+
},
64+
}, ...compat.extends(
65+
"plugin:@typescript-eslint/eslint-recommended",
66+
"plugin:@typescript-eslint/recommended",
67+
).map(config => ({
68+
...config,
69+
files: ["**/*.ts"],
70+
})), {
71+
files: ["**/*.ts"],
72+
73+
plugins: {
74+
"@typescript-eslint": typescriptEslint,
75+
},
76+
77+
languageOptions: {
78+
parser: tsParser,
79+
},
80+
81+
rules: {
82+
"@typescript-eslint/ban-ts-comment": "off",
83+
"@typescript-eslint/no-unused-vars": "warn",
84+
"@typescript-eslint/no-explicit-any": "off",
85+
},
86+
}];
87+
88+
export default config;

package-lock.json

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

package.json

+6-3
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,29 @@
1818
},
1919
"scripts": {
2020
"build": "rm -rf lib && tsc -p tsconfig.build.json",
21-
"lint": "eslint src --ext .ts"
21+
"lint": "eslint src"
2222
},
2323
"type": "module",
2424
"devDependencies": {
25+
"@babel/eslint-parser": "^7.25.9",
26+
"@eslint/eslintrc": "^3.2.0",
27+
"@eslint/js": "^9.16.0",
2528
"@types/chai": "^5.0.1",
2629
"@types/memoizee": "^0.4.11",
2730
"@types/mocha": "^10.0.10",
2831
"@types/node": "^22.10.2",
2932
"@typescript-eslint/eslint-plugin": "^8.18.0",
3033
"@typescript-eslint/parser": "^8.18.0",
31-
"@babel/eslint-parser": "^7.25.9",
3234
"chai": "^5.1.2",
3335
"eslint": "^9.16.0",
36+
"globals": "^15.13.0",
3437
"mocha": "^11.0.1",
3538
"typescript": "^5.7.2",
3639
"vue-eslint-parser": "^9.4.3"
3740
},
3841
"dependencies": {
39-
"bignumber.js": "^9.1.2",
4042
"@curvefi/ethcall": "6.0.7",
43+
"bignumber.js": "^9.1.2",
4144
"ethers": "^6.13.4",
4245
"memoizee": "^0.4.17"
4346
}

src/external-api.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ export const _getDaoProposalList = memoize(async (): Promise<IDaoProposalListIte
181181
})
182182

183183
export const _getDaoProposal = memoize((type: "PARAMETER" | "OWNERSHIP", id: number): Promise<IDaoProposal> =>
184-
fetchJson(`https://api-py.llama.airforce/curve/v1/dao/proposals/${type.toLowerCase()}/${id}`),
184+
fetchJson(`https://api-py.llama.airforce/curve/v1/dao/proposals/${type.toLowerCase()}/${id}`),
185185
{
186186
promise: true,
187187
maxAge: 5 * 60 * 1000, // 5m

0 commit comments

Comments
 (0)