Skip to content

Commit

Permalink
Convert eslint config to js
Browse files Browse the repository at this point in the history
Fix lint error from sentry package
  • Loading branch information
jmrossy committed Nov 5, 2024
1 parent 7b788b3 commit f0542ad
Show file tree
Hide file tree
Showing 7 changed files with 231 additions and 2,246 deletions.
9 changes: 0 additions & 9 deletions .eslintignore

This file was deleted.

46 changes: 0 additions & 46 deletions .eslintrc

This file was deleted.

84 changes: 84 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
import { FlatCompat } from '@eslint/eslintrc';
import js from '@eslint/js';
import typescriptEslint from '@typescript-eslint/eslint-plugin';
import tsParser from '@typescript-eslint/parser';
import globals from 'globals';
import path from 'node:path';
import { fileURLToPath } from 'node:url';

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: [
'**/node_modules',
'**/dist',
'**/build',
'**/coverage',
'**/postcss.config.js',
'**/next.config.js',
'**/tailwind.config.js',
'**/sentry.*',
],
},
...compat.extends(
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@tanstack/eslint-plugin-query/recommended',
'next',
'next/core-web-vitals',
'prettier',
),
{
plugins: {
'@typescript-eslint': typescriptEslint,
},

languageOptions: {
globals: {
...globals.node,
...globals.browser,
},

parser: tsParser,
ecmaVersion: 12,
sourceType: 'module',

parserOptions: {
project: './tsconfig.json',
},
},

rules: {
'no-console': ['warn'],
'no-eval': ['error'],
'no-ex-assign': ['error'],
'no-extra-boolean-cast': ['error'],
'no-constant-condition': ['off'],
'guard-for-in': ['error'],
'@typescript-eslint/ban-ts-comment': ['off'],
'@typescript-eslint/explicit-module-boundary-types': ['off'],
'@typescript-eslint/no-explicit-any': ['off'],
'@typescript-eslint/no-non-null-assertion': ['off'],
'@typescript-eslint/no-require-imports': ['warn'],

'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
},
],

'jsx-a11y/alt-text': ['off'],
'@next/next/no-img-element': ['off'],
},
},
];
23 changes: 0 additions & 23 deletions jest.config.js

This file was deleted.

12 changes: 5 additions & 7 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/** @type {import('next').NextConfig} */


const { version } = require('./package.json')
const { withSentryConfig } = require("@sentry/nextjs");
const withBundleAnalyzer = require('@next/bundle-analyzer')({
Expand Down Expand Up @@ -81,22 +82,19 @@ const nextConfig = {

reactStrictMode: true,
swcMinify: true,

sentry: {
hideSourceMaps: true,
tunnelRoute: "/monitoring-tunnel",
},
}

const sentryWebpackPluginOptions = {
const sentryOptions = {
org: "hyperlane",
project: "warp-ui",
authToken: process.env.SENTRY_AUTH_TOKEN,
hideSourceMaps: true,
tunnelRoute: "/monitoring-tunnel",
bundleSizeOptimizations: {
excludeDebugStatements: true,
excludeReplayIframe: true,
excludeReplayShadowDom: true,
},
};

module.exports = withBundleAnalyzer(withSentryConfig(nextConfig, sentryWebpackPluginOptions));
module.exports = withBundleAnalyzer(withSentryConfig(nextConfig, sentryOptions));
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
"devDependencies": {
"@next/bundle-analyzer": "^15.0.2",
"@tanstack/eslint-plugin-query": "^5.28.6",
"@types/jest": "^29.5.14",
"@types/node": "^18.11.18",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
Expand All @@ -63,8 +62,6 @@
"eslint": "^9.14.0",
"eslint-config-next": "^15.0.2",
"eslint-config-prettier": "^9.1.0",
"jest": "^29.7.0",
"jest-transform-yaml": "^1.1.2",
"postcss": "^8.4.47",
"prettier": "^3.2.5",
"prettier-plugin-organize-imports": "^4.1.0",
Expand All @@ -91,7 +88,6 @@
"typecheck": "tsc",
"lint": "next lint",
"start": "next start",
"test": "jest --passWithNoTests",
"prettier": "prettier --write ./src"
},
"types": "dist/src/index.d.ts",
Expand All @@ -102,6 +98,7 @@
"bn.js": "^5.2",
"cosmjs-types": "0.9",
"ethers": "^5.7",
"globals": "^14.0.0",
"lit-html": "2.8.0",
"react-fast-compare": "^3.2",
"viem": "1.20.0",
Expand Down
Loading

0 comments on commit f0542ad

Please sign in to comment.