Skip to content

Commit

Permalink
Merge pull request #256 from cosmos/upgrade-lint
Browse files Browse the repository at this point in the history
Upgrade eslint to v9
webmaster128 authored Jan 15, 2025
2 parents 8edea74 + 61fb0c0 commit b5fab6c
Showing 9 changed files with 1,837 additions and 1,292 deletions.
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

38 changes: 0 additions & 38 deletions .eslintrc.js

This file was deleted.

6 changes: 3 additions & 3 deletions components/forms/CreateTxForm/Fields/FieldCommission.tsx
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ export const getFieldCommissionSchema = (fieldName: string) =>
.transform((value) => {
try {
return String(value);
} catch (error) {
} catch {
return value;
}
}),
@@ -28,7 +28,7 @@ export const getFieldCommissionSchema = (fieldName: string) =>
.transform((value) => {
try {
return String(value);
} catch (error) {
} catch {
return value;
}
}),
@@ -38,7 +38,7 @@ export const getFieldCommissionSchema = (fieldName: string) =>
.transform((value) => {
try {
return String(value);
} catch (error) {
} catch {
return value;
}
}),
4 changes: 2 additions & 2 deletions components/forms/CreateTxForm/Fields/FieldNumber.tsx
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ export const getFieldNumberSchema = (fieldName: string) => {
.transform((value) => {
try {
return BigInt(value);
} catch (error) {
} catch {
return value;
}
})
@@ -38,7 +38,7 @@ export const getFieldNumberSchema = (fieldName: string) => {
.transform((value) => {
try {
return String(value);
} catch (error) {
} catch {
return value;
}
});
4 changes: 2 additions & 2 deletions components/forms/CreateTxForm/Fields/FieldTimeoutHeight.tsx
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ export const getFieldTimeoutHeightSchema = (fieldName: string) =>
.transform((value) => {
try {
return BigInt(value);
} catch (error) {
} catch {
return value;
}
})
@@ -31,7 +31,7 @@ export const getFieldTimeoutHeightSchema = (fieldName: string) =>
.transform((value) => {
try {
return BigInt(value);
} catch (error) {
} catch {
return value;
}
})
91 changes: 91 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
import typescriptEslint from "@typescript-eslint/eslint-plugin";
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: ["components/ui/"],
},
...compat.extends("next/core-web-vitals", "plugin:@typescript-eslint/recommended", "prettier"),
{
plugins: {
"@typescript-eslint": typescriptEslint,
},

languageOptions: {
globals: {
...globals.browser,
process: "readonly",
},

parser: tsParser,
ecmaVersion: 2020,
sourceType: "module",

parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},

rules: {
curly: ["warn", "multi-line", "consistent"],
"no-bitwise": "warn",
"no-console": "off",
"no-param-reassign": "warn",
"no-shadow": "warn",
"no-unused-vars": "off",
"prefer-const": "warn",
radix: ["warn", "always"],

"spaced-comment": [
"warn",
"always",
{
line: {
markers: ["/ <reference"],
},
},
],

"react/no-unescaped-entities": [
"warn",
{
forbid: [">", "}"],
},
],

"react/prop-types": "off",
"@typescript-eslint/no-empty-function": "off",

"@typescript-eslint/no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
},
],
},
},
// Be less docmatic for config files
{
files: ["**/*.config.{mjs,js}"],
rules: {
"@typescript-eslint/no-require-imports": "off",
"import/no-anonymous-default-export": "off",
},
},
];
Loading

0 comments on commit b5fab6c

Please sign in to comment.