-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: upgrade nextjs, typescript, eslint and other toolings (#146)
Fixes #141 - Upgrade from Next 13 to 15 - Upgrade `eslint` and `typescript` and other toolings - Change `eslint` file to `eslint.config.mjs` - Removed unused `error` variables in `catch` - Removed `swcMinify` in `next.js.config`, since it comes by default (https://github.com/vercel/next.js/blob/3d5aa278e6e0f8a5330f21a8d2f9fe305c1e36a1/docs/03-architecture/nextjs-compiler.mdx?plain=1#L243-L254) Copy from [warp-ui #311](hyperlane-xyz/hyperlane-warp-ui-template#311)
- Loading branch information
Showing
17 changed files
with
2,200 additions
and
1,009 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
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', | ||
], | ||
}, | ||
...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: { | ||
camelcase: ['error'], | ||
'guard-for-in': ['error'], | ||
'import/no-cycle': ['error'], | ||
'import/no-self-import': ['error'], | ||
'no-console': ['warn'], | ||
'no-eval': ['error'], | ||
'no-ex-assign': ['error'], | ||
'no-extra-boolean-cast': ['error'], | ||
'no-constant-condition': ['off'], | ||
'no-multiple-empty-lines': ['error'], | ||
'jsx-a11y/alt-text': ['off'], | ||
|
||
'@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: '^_', | ||
}, | ||
], | ||
|
||
'@next/next/no-img-element': ['off'], | ||
}, | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.