Skip to content

Commit

Permalink
Merge pull request #24 from defi-wonderland/dev
Browse files Browse the repository at this point in the history
release: boilerplate update
  • Loading branch information
Onizuka-wl authored Oct 9, 2024
2 parents edb0437 + 1d806cb commit 57944ee
Show file tree
Hide file tree
Showing 39 changed files with 9,325 additions and 7,798 deletions.
24 changes: 0 additions & 24 deletions .eslintrc.cjs

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v3
with:
version: 8
version: 9

- name: Install Node
uses: actions/setup-node@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

- uses: pnpm/action-setup@v3
with:
version: 8
version: 9

- name: Create env file
run: |
Expand Down
4 changes: 0 additions & 4 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"


npx lint-staged

. "$(dirname "$0")/wonderland/find-crypto-keys.sh"
105 changes: 105 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
import path from 'node:path';
import { fileURLToPath } from 'node:url';

import { fixupConfigRules, fixupPluginRules } from '@eslint/compat';
import { FlatCompat } from '@eslint/eslintrc';
import js from '@eslint/js';
import tsParser from '@typescript-eslint/parser';
import prettierConfig from 'eslint-config-prettier';
import importPlugin from 'eslint-plugin-import';
import prettierPlugin from 'eslint-plugin-prettier';
import reactRefresh from 'eslint-plugin-react-refresh';
import globals from 'globals';

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: ['**/dist', '**/eslint.config.mjs'],
},
...fixupConfigRules(
compat.extends(
'prettier',
'plugin:react/recommended',
'plugin:jsx-a11y/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:import/typescript',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
'plugin:@next/next/recommended',
),
),
{
files: ['**/*.{js,mjs,cjs,jsx,ts,tsx}'],
plugins: {
'react-refresh': reactRefresh,
import: fixupPluginRules(importPlugin),
prettier: fixupPluginRules(prettierPlugin),
},
languageOptions: {
globals: {
...globals.browser,
},
parser: tsParser,
},
rules: {
'import/order': [
'error',
{
'newlines-between': 'never',
alphabetize: {
order: 'asc',
caseInsensitive: false,
},
// Enforce a specific import order
groups: ['external', 'builtin', 'parent', 'sibling', 'index', 'object', 'type', 'unknown'],
pathGroups: [
{
pattern: 'react',
group: 'external',
position: 'before',
},
{
pattern: 'next',
group: 'external',
position: 'before',
},
{
pattern: 'next/**',
group: 'external',
position: 'before',
},
{
pattern: '~/assets/**',
group: 'unknown',
position: 'after',
},
{
pattern: '~/**',
group: 'parent',
position: 'before',
},
],
pathGroupsExcludedImportTypes: ['react'],
},
],
// Prettier plugin to apply formatting rules
'prettier/prettier': 'error', // This tells ESLint to show Prettier errors as ESLint errors
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-empty-interface': 'off',
},
settings: {
// Spread Prettier config to disable conflicting ESLint rules
...prettierConfig,
react: {
version: 'detect',
},
},
},
];
2 changes: 1 addition & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Config } from 'jest';
import nextJest from 'next/jest.js';
import type { Config } from 'jest';

const createJestConfig = nextJest({
// Provide the path to your Next.js app to load next.config.js and .env files in your test environment
Expand Down
83 changes: 42 additions & 41 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
"start": "next start -p 3000",
"preview": "next start",
"lint": "eslint 'src/**/*.{js,jsx,ts,tsx}'",
"lint:fix": "pnpm run lint -- --fix",
"lint:fix": "pnpm run lint --fix",
"prettier": "prettier src --check",
"prettier:fix": "pnpm run prettier -- --write",
"prettier:fix": "pnpm run prettier --write",
"format": "pnpm run prettier:fix && yarn run lint:fix",
"format:check": "pnpm run prettier && yarn run lint",
"prepare": "husky install && wonderland-crypto-husky-checks install",
"prepare": "husky && wonderland-crypto-husky-checks install",
"cypress:open": "cypress open",
"cypress:run": "cypress run",
"test:e2e": "pnpm cypress run",
Expand All @@ -31,54 +31,55 @@
"src/**/*.{js,jsx,ts,tsx,css,scss,md,html}": "prettier --write --ignore-unknown"
},
"dependencies": {
"@emotion/cache": "11.11.0",
"@emotion/react": "11.11.3",
"@emotion/cache": "11.13.1",
"@emotion/react": "11.13.3",
"@emotion/server": "11.11.0",
"@emotion/styled": "11.11.0",
"@mui/icons-material": "5.15.6",
"@mui/material": "5.15.14",
"@mui/material-nextjs": "5.15.11",
"@next/eslint-plugin-next": "14.1.3",
"@rainbow-me/rainbowkit": "2.0.2",
"@tanstack/react-query": "5.28.0",
"next": "14.1.3",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-router-dom": "6.15.0",
"viem": "2.8.6",
"wagmi": "2.5.7"
"@emotion/styled": "11.13.0",
"@mui/icons-material": "6.1.1",
"@mui/material": "6.1.1",
"@mui/material-nextjs": "6.1.1",
"@next/eslint-plugin-next": "14.2.13",
"@rainbow-me/rainbowkit": "2.1.7",
"@tanstack/react-query": "5.56.2",
"next": "14.2.13",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-router-dom": "6.26.2",
"viem": "2.21.15",
"wagmi": "2.12.16"
},
"devDependencies": {
"@defi-wonderland/crypto-husky-checks": "1.3.0",
"@defi-wonderland/crypto-husky-checks": "1.4.0",
"@eslint/compat": "1.1.1",
"@eslint/eslintrc": "3.1.0",
"@eslint/js": "9.11.1",
"@jest/globals": "29.7.0",
"@testing-library/jest-dom": "6.1.2",
"@testing-library/react": "14.2.1",
"@testing-library/user-event": "14.4.3",
"@types/jest": "29.5.12",
"@types/lodash.merge": "4.6.7",
"@types/node": "20.12.13",
"@types/react": "18.2.15",
"@types/react-dom": "18.2.7",
"@typescript-eslint/eslint-plugin": "6.0.0",
"@typescript-eslint/parser": "6.0.0",
"cypress": "13.7.0",
"eslint": "8.45.0",
"eslint-config-prettier": "9.0.0",
"eslint-plugin-import": "2.28.1",
"eslint-plugin-jsx-a11y": "6.7.1",
"eslint-plugin-prettier": "5.0.0",
"eslint-plugin-react": "7.33.2",
"@types/node": "22.7.4",
"@types/react": "18.3.10",
"@types/react-dom": "18.3.0",
"@typescript-eslint/eslint-plugin": "8.7.0",
"@typescript-eslint/parser": "8.7.0",
"cypress": "13.15.0",
"eslint": "9.11.1",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-import": "2.30.0",
"eslint-plugin-jsx-a11y": "6.10.0",
"eslint-plugin-prettier": "5.2.1",
"eslint-plugin-react": "7.37.0",
"eslint-plugin-react-hooks": "4.6.0",
"eslint-plugin-react-refresh": "0.4.3",
"husky": "8.0.3",
"eslint-plugin-react-refresh": "0.4.12",
"globals": "15.9.0",
"husky": "9.1.6",
"jest": "29.7.0",
"jest-environment-jsdom": "29.7.0",
"jsdom": "24.0.0",
"jsdom": "25.0.1",
"lodash.merge": "4.6.2",
"prettier": "3.0.3",
"styled-components": "6.0.7",
"ts-jest": "29.1.4",
"prettier": "3.3.3",
"styled-components": "6.1.13",
"ts-jest": "29.2.5",
"ts-node": "10.9.2",
"typescript": "5.4.2"
"typescript": "5.6.2"
}
}
Loading

0 comments on commit 57944ee

Please sign in to comment.