Merge pull request #256 from cosmos/upgrade-lint

Upgrade eslint to v9
This commit is contained in:
Simon Warta
2025-01-15 11:36:40 +01:00
committed by GitHub
9 changed files with 1849 additions and 1304 deletions
-2
View File
@@ -1,2 +0,0 @@
# Shadcn ui components
/components/ui/
-38
View File
@@ -1,38 +0,0 @@
/* global module */
module.exports = {
env: {
es6: true,
browser: true,
},
globals: {
process: "readonly",
},
parser: "@typescript-eslint/parser",
parserOptions: {
sourceType: "module",
ecmaVersion: 2020,
ecmaFeatures: {
jsx: true,
},
},
plugins: ["@typescript-eslint"],
extends: ["next/core-web-vitals", "plugin:@typescript-eslint/recommended", "prettier"],
rules: {
curly: ["warn", "multi-line", "consistent"],
"no-bitwise": "warn",
"no-console": "off",
"no-param-reassign": "warn",
"no-shadow": "warn",
"no-unused-vars": "off", // Use @typescript-eslint/no-unused-vars instead
"prefer-const": "warn",
radix: ["warn", "always"],
"spaced-comment": ["warn", "always", { line: { markers: ["/ <reference"] } }],
"react/no-unescaped-entities": ["warn", { forbid: [">", "}"] }], // by default we can't use ' which is annoying
"react/prop-types": "off", // we take care of this with TypeScript
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
],
},
};
@@ -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;
}
}),
@@ -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;
}
});
@@ -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
View File
@@ -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",
},
},
];
+1742 -1248
View File
File diff suppressed because it is too large Load Diff
+8 -8
View File
@@ -8,8 +8,8 @@
"build": "next build",
"start": "next start",
"format": "prettier --write --log-level warn \"./**/*.{js,jsx,mjs,ts,tsx}\"",
"lint": "eslint --max-warnings 0 \"./**/*.{js,jsx,ts,tsx}\"",
"lint:fix": "eslint --max-warnings 0 \"./**/*.{js,jsx,ts,tsx}\" --fix"
"lint": "eslint --max-warnings 0 \"./**/*.{js,jsx,mjs,ts,tsx}\"",
"lint:fix": "eslint --max-warnings 0 \"./**/*.{js,jsx,mjs,ts,tsx}\" --fix"
},
"dependencies": {
"@cosmjs/amino": "^0.32.4",
@@ -57,8 +57,8 @@
"@types/node": "20.14.9",
"@types/react": "18.3.3",
"@types/react-dom": "18.3.0",
"@typescript-eslint/eslint-plugin": "^6.6.0",
"@typescript-eslint/parser": "^6.6.0",
"@typescript-eslint/eslint-plugin": "^8.20.0",
"@typescript-eslint/parser": "^8.20.0",
"autoprefixer": "10.4.19",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
@@ -66,15 +66,15 @@
"copy-to-clipboard": "^3.3.3",
"cosmjs-types": "^0.9.0",
"date-fns": "^3.6.0",
"eslint": "^8.56.0",
"eslint-config-next": "14.2.4",
"eslint-config-prettier": "^9.1.0",
"eslint": "^9.18.0",
"eslint-config-next": "^15.1.4",
"eslint-config-prettier": "^10.0.1",
"graphql": "^16.9.0",
"graphql-request": "^7.1.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"lucide-react": "^0.397.0",
"next": "14.2.4",
"next": "^14.2.23",
"next-themes": "^0.3.0",
"postcss": "8.4.38",
"prettier": "^3.4.2",
+1 -1
View File
@@ -1,6 +1,6 @@
import { Window as KeplrWindow } from "@keplr-wallet/types";
declare global {
// eslint-disable-next-line @typescript-eslint/no-empty-interface
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
interface Window extends KeplrWindow {}
}