EsLint speedup (#161)

* Updated packages
* Fix Turbo TURBO_SCM_BASE
* Disable type-aware rules
This commit is contained in:
Giancarlo Buomprisco
2025-02-12 13:58:56 +07:00
committed by GitHub
parent f2c74bd11c
commit e403a6cd75
30 changed files with 1256 additions and 1299 deletions

View File

@@ -15,6 +15,7 @@ jobs:
STRIPE_SECRET_KEY: ${{ secrets.STRIPE_SECRET_KEY }} STRIPE_SECRET_KEY: ${{ secrets.STRIPE_SECRET_KEY }}
STRIPE_WEBHOOK_SECRET: ${{ secrets.STRIPE_WEBHOOK_SECRET }} STRIPE_WEBHOOK_SECRET: ${{ secrets.STRIPE_WEBHOOK_SECRET }}
DO_NOT_TRACK: 1 DO_NOT_TRACK: 1
TURBO_SCM_BASE: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@@ -56,6 +57,7 @@ jobs:
STRIPE_WEBHOOK_SECRET: ${{ secrets.STRIPE_WEBHOOK_SECRET }} STRIPE_WEBHOOK_SECRET: ${{ secrets.STRIPE_WEBHOOK_SECRET }}
ENABLE_BILLING_TESTS: ${{ vars.ENABLE_BILLING_TESTS }} ENABLE_BILLING_TESTS: ${{ vars.ENABLE_BILLING_TESTS }}
DO_NOT_TRACK: 1 DO_NOT_TRACK: 1
TURBO_SCM_BASE: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4

View File

@@ -58,7 +58,7 @@
"@radix-ui/react-icons": "^1.3.2", "@radix-ui/react-icons": "^1.3.2",
"@supabase/supabase-js": "2.48.1", "@supabase/supabase-js": "2.48.1",
"@tanstack/react-query": "5.66.0", "@tanstack/react-query": "5.66.0",
"@tanstack/react-table": "^8.20.6", "@tanstack/react-table": "^8.21.2",
"date-fns": "^4.1.0", "date-fns": "^4.1.0",
"lucide-react": "^0.475.0", "lucide-react": "^0.475.0",
"next": "15.1.7", "next": "15.1.7",
@@ -71,7 +71,7 @@
"recharts": "2.15.1", "recharts": "2.15.1",
"sonner": "^1.7.4", "sonner": "^1.7.4",
"tailwind-merge": "^3.0.1", "tailwind-merge": "^3.0.1",
"zod": "^3.24.1" "zod": "^3.24.2"
}, },
"devDependencies": { "devDependencies": {
"@kit/eslint-config": "workspace:*", "@kit/eslint-config": "workspace:*",
@@ -88,7 +88,7 @@
"dotenv-cli": "^8.0.0", "dotenv-cli": "^8.0.0",
"pino-pretty": "^13.0.0", "pino-pretty": "^13.0.0",
"prettier": "^3.5.0", "prettier": "^3.5.0",
"supabase": "^2.12.0", "supabase": "^2.12.1",
"tailwindcss": "4.0.6", "tailwindcss": "4.0.6",
"tailwindcss-animate": "^1.0.7", "tailwindcss-animate": "^1.0.7",
"typescript": "^5.7.3" "typescript": "^5.7.3"

View File

@@ -21,7 +21,7 @@
"@kit/supabase": "workspace:*", "@kit/supabase": "workspace:*",
"@kit/tsconfig": "workspace:*", "@kit/tsconfig": "workspace:*",
"@kit/ui": "workspace:*", "@kit/ui": "workspace:*",
"zod": "^3.24.1" "zod": "^3.24.2"
}, },
"typesVersions": { "typesVersions": {
"*": { "*": {

View File

@@ -34,7 +34,7 @@
"react": "19.0.0", "react": "19.0.0",
"react-hook-form": "^7.54.2", "react-hook-form": "^7.54.2",
"react-i18next": "^15.4.0", "react-i18next": "^15.4.0",
"zod": "^3.24.1" "zod": "^3.24.2"
}, },
"typesVersions": { "typesVersions": {
"*": { "*": {

View File

@@ -27,7 +27,7 @@
"@types/react": "19.0.8", "@types/react": "19.0.8",
"next": "15.1.7", "next": "15.1.7",
"react": "19.0.0", "react": "19.0.0",
"zod": "^3.24.1" "zod": "^3.24.2"
}, },
"typesVersions": { "typesVersions": {
"*": { "*": {

View File

@@ -31,7 +31,7 @@
"date-fns": "^4.1.0", "date-fns": "^4.1.0",
"next": "15.1.7", "next": "15.1.7",
"react": "19.0.0", "react": "19.0.0",
"zod": "^3.24.1" "zod": "^3.24.2"
}, },
"typesVersions": { "typesVersions": {
"*": { "*": {

View File

@@ -16,9 +16,9 @@
"./route-handler": "./src/keystatic-route-handler.ts" "./route-handler": "./src/keystatic-route-handler.ts"
}, },
"dependencies": { "dependencies": {
"@keystatic/core": "0.5.43", "@keystatic/core": "0.5.45",
"@keystatic/next": "^5.0.2", "@keystatic/next": "^5.0.3",
"@markdoc/markdoc": "^0.5.0" "@markdoc/markdoc": "^0.5.1"
}, },
"devDependencies": { "devDependencies": {
"@kit/cms-types": "workspace:*", "@kit/cms-types": "workspace:*",
@@ -29,7 +29,7 @@
"@types/node": "^22.13.1", "@types/node": "^22.13.1",
"@types/react": "19.0.8", "@types/react": "19.0.8",
"react": "19.0.0", "react": "19.0.0",
"zod": "^3.24.1" "zod": "^3.24.2"
}, },
"typesVersions": { "typesVersions": {
"*": { "*": {

View File

@@ -23,7 +23,7 @@
"@kit/team-accounts": "workspace:*", "@kit/team-accounts": "workspace:*",
"@kit/tsconfig": "workspace:*", "@kit/tsconfig": "workspace:*",
"@supabase/supabase-js": "2.48.1", "@supabase/supabase-js": "2.48.1",
"zod": "^3.24.1" "zod": "^3.24.2"
}, },
"typesVersions": { "typesVersions": {
"*": { "*": {

View File

@@ -45,7 +45,7 @@
"react-hook-form": "^7.54.2", "react-hook-form": "^7.54.2",
"react-i18next": "^15.4.0", "react-i18next": "^15.4.0",
"sonner": "^1.7.4", "sonner": "^1.7.4",
"zod": "^3.24.1" "zod": "^3.24.2"
}, },
"prettier": "@kit/prettier-config", "prettier": "@kit/prettier-config",
"typesVersions": { "typesVersions": {

View File

@@ -412,6 +412,7 @@ function FactorNameForm(
} }
function QrImage({ src }: { src: string }) { function QrImage({ src }: { src: string }) {
// eslint-disable-next-line @next/next/no-img-element
return <img alt={'QR Code'} src={src} width={160} height={160} />; return <img alt={'QR Code'} src={src} width={160} height={160} />;
} }

View File

@@ -22,14 +22,14 @@
"@makerkit/data-loader-supabase-nextjs": "^1.2.3", "@makerkit/data-loader-supabase-nextjs": "^1.2.3",
"@supabase/supabase-js": "2.48.1", "@supabase/supabase-js": "2.48.1",
"@tanstack/react-query": "5.66.0", "@tanstack/react-query": "5.66.0",
"@tanstack/react-table": "^8.20.6", "@tanstack/react-table": "^8.21.2",
"@types/react": "19.0.8", "@types/react": "19.0.8",
"lucide-react": "^0.475.0", "lucide-react": "^0.475.0",
"next": "15.1.7", "next": "15.1.7",
"react": "19.0.0", "react": "19.0.0",
"react-dom": "19.0.0", "react-dom": "19.0.0",
"react-hook-form": "^7.54.2", "react-hook-form": "^7.54.2",
"zod": "^3.24.1" "zod": "^3.24.2"
}, },
"exports": { "exports": {
".": "./src/index.ts", ".": "./src/index.ts",

View File

@@ -36,7 +36,7 @@
"react-hook-form": "^7.54.2", "react-hook-form": "^7.54.2",
"react-i18next": "^15.4.0", "react-i18next": "^15.4.0",
"sonner": "^1.7.4", "sonner": "^1.7.4",
"zod": "^3.24.1" "zod": "^3.24.2"
}, },
"prettier": "@kit/prettier-config", "prettier": "@kit/prettier-config",
"typesVersions": { "typesVersions": {

View File

@@ -33,7 +33,7 @@
"@kit/ui": "workspace:*", "@kit/ui": "workspace:*",
"@supabase/supabase-js": "2.48.1", "@supabase/supabase-js": "2.48.1",
"@tanstack/react-query": "5.66.0", "@tanstack/react-query": "5.66.0",
"@tanstack/react-table": "^8.20.6", "@tanstack/react-table": "^8.21.2",
"@types/react": "19.0.8", "@types/react": "19.0.8",
"@types/react-dom": "19.0.3", "@types/react-dom": "19.0.3",
"class-variance-authority": "^0.7.1", "class-variance-authority": "^0.7.1",
@@ -45,7 +45,7 @@
"react-hook-form": "^7.54.2", "react-hook-form": "^7.54.2",
"react-i18next": "^15.4.0", "react-i18next": "^15.4.0",
"sonner": "^1.7.4", "sonner": "^1.7.4",
"zod": "^3.24.1" "zod": "^3.24.2"
}, },
"prettier": "@kit/prettier-config", "prettier": "@kit/prettier-config",
"typesVersions": { "typesVersions": {

View File

@@ -21,7 +21,7 @@
"@kit/shared": "workspace:*", "@kit/shared": "workspace:*",
"@kit/tsconfig": "workspace:*", "@kit/tsconfig": "workspace:*",
"@types/node": "^22.13.1", "@types/node": "^22.13.1",
"zod": "^3.24.1" "zod": "^3.24.2"
}, },
"typesVersions": { "typesVersions": {
"*": { "*": {

View File

@@ -21,7 +21,7 @@
"@kit/prettier-config": "workspace:*", "@kit/prettier-config": "workspace:*",
"@kit/tsconfig": "workspace:*", "@kit/tsconfig": "workspace:*",
"@types/nodemailer": "6.4.17", "@types/nodemailer": "6.4.17",
"zod": "^3.24.1" "zod": "^3.24.2"
}, },
"typesVersions": { "typesVersions": {
"*": { "*": {

View File

@@ -18,7 +18,7 @@
"@kit/prettier-config": "workspace:*", "@kit/prettier-config": "workspace:*",
"@kit/tsconfig": "workspace:*", "@kit/tsconfig": "workspace:*",
"@types/node": "^22.13.1", "@types/node": "^22.13.1",
"zod": "^3.24.1" "zod": "^3.24.2"
}, },
"typesVersions": { "typesVersions": {
"*": { "*": {

View File

@@ -16,7 +16,7 @@
"@kit/eslint-config": "workspace:*", "@kit/eslint-config": "workspace:*",
"@kit/prettier-config": "workspace:*", "@kit/prettier-config": "workspace:*",
"@kit/tsconfig": "workspace:*", "@kit/tsconfig": "workspace:*",
"zod": "^3.24.1" "zod": "^3.24.2"
}, },
"typesVersions": { "typesVersions": {
"*": { "*": {

View File

@@ -26,7 +26,7 @@
"@kit/tsconfig": "workspace:*", "@kit/tsconfig": "workspace:*",
"@types/react": "19.0.8", "@types/react": "19.0.8",
"react": "19.0.0", "react": "19.0.0",
"zod": "^3.24.1" "zod": "^3.24.2"
}, },
"typesVersions": { "typesVersions": {
"*": { "*": {

View File

@@ -26,7 +26,7 @@
"@kit/tsconfig": "workspace:*", "@kit/tsconfig": "workspace:*",
"@types/react": "19.0.8", "@types/react": "19.0.8",
"react": "19.0.0", "react": "19.0.0",
"zod": "^3.24.1" "zod": "^3.24.2"
}, },
"typesVersions": { "typesVersions": {
"*": { "*": {

View File

@@ -16,7 +16,7 @@
"./config/server": "./src/sentry.client.server.ts" "./config/server": "./src/sentry.client.server.ts"
}, },
"dependencies": { "dependencies": {
"@sentry/nextjs": "^9.0.0", "@sentry/nextjs": "^9.0.1",
"import-in-the-middle": "1.13.0" "import-in-the-middle": "1.13.0"
}, },
"devDependencies": { "devDependencies": {

View File

@@ -22,7 +22,7 @@
"@kit/tsconfig": "workspace:*", "@kit/tsconfig": "workspace:*",
"@supabase/supabase-js": "2.48.1", "@supabase/supabase-js": "2.48.1",
"next": "15.1.7", "next": "15.1.7",
"zod": "^3.24.1" "zod": "^3.24.2"
}, },
"typesVersions": { "typesVersions": {
"*": { "*": {

View File

@@ -34,7 +34,7 @@
"next": "15.1.7", "next": "15.1.7",
"react": "19.0.0", "react": "19.0.0",
"server-only": "^0.0.1", "server-only": "^0.0.1",
"zod": "^3.24.1" "zod": "^3.24.2"
}, },
"typesVersions": { "typesVersions": {
"*": { "*": {

View File

@@ -44,12 +44,12 @@
"@kit/tsconfig": "workspace:*", "@kit/tsconfig": "workspace:*",
"@radix-ui/react-icons": "^1.3.2", "@radix-ui/react-icons": "^1.3.2",
"@tanstack/react-query": "5.66.0", "@tanstack/react-query": "5.66.0",
"@tanstack/react-table": "^8.20.6", "@tanstack/react-table": "^8.21.2",
"@types/react": "19.0.8", "@types/react": "19.0.8",
"@types/react-dom": "19.0.3", "@types/react-dom": "19.0.3",
"class-variance-authority": "^0.7.1", "class-variance-authority": "^0.7.1",
"date-fns": "^4.1.0", "date-fns": "^4.1.0",
"eslint": "^9.20.0", "eslint": "^9.20.1",
"next": "15.1.7", "next": "15.1.7",
"next-themes": "0.4.4", "next-themes": "0.4.4",
"prettier": "^3.5.0", "prettier": "^3.5.0",
@@ -60,7 +60,7 @@
"tailwindcss": "4.0.6", "tailwindcss": "4.0.6",
"tailwindcss-animate": "^1.0.7", "tailwindcss-animate": "^1.0.7",
"typescript": "^5.7.3", "typescript": "^5.7.3",
"zod": "^3.24.1" "zod": "^3.24.2"
}, },
"prettier": "@kit/prettier-config", "prettier": "@kit/prettier-config",
"exports": { "exports": {

2423
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
export default [ export default [
{ {
files: ['**/*.{ts,tsx}'], files: ['app/**/*.{ts,tsx}'],
rules: { rules: {
'no-restricted-imports': [ 'no-restricted-imports': [
'error', 'error',

View File

@@ -1,8 +1,5 @@
import eslint from '@eslint/js'; import eslint from '@eslint/js';
import eslintConfigPrettier from 'eslint-config-prettier'; import turboConfig from 'eslint-config-turbo/flat';
import eslintReact from 'eslint-plugin-react';
import reactPlugin from 'eslint-plugin-react';
import hooksPlugin from 'eslint-plugin-react-hooks';
import tsEsLint from 'typescript-eslint'; import tsEsLint from 'typescript-eslint';
import nextConfig from './nextjs.js'; import nextConfig from './nextjs.js';
@@ -10,45 +7,28 @@ import nextConfig from './nextjs.js';
export default tsEsLint.config( export default tsEsLint.config(
eslint.configs.recommended, eslint.configs.recommended,
tsEsLint.configs.recommended, tsEsLint.configs.recommended,
eslintReact.configs.flat.recommended, nextConfig,
{ turboConfig,
languageOptions: {
parserOptions: {
ecmaVersion: 2022,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
modules: true,
},
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
{ {
settings: { settings: {
react: { react: {
version: 'detect', version: '19.0',
}, },
}, },
}, },
{
plugins: {
'react-hooks': hooksPlugin,
},
rules: hooksPlugin.configs.recommended.rules,
},
{
files: ['**/*.{ts,tsx}'],
...reactPlugin.configs.flat['jsx-runtime'],
...reactPlugin.configs.flat.recommended,
},
nextConfig,
eslintConfigPrettier,
{ {
rules: { rules: {
'react/react-in-jsx-scope': 'off', 'react/react-in-jsx-scope': 'off',
'import/no-anonymous-default-export': 'off', 'import/no-anonymous-default-export': 'off',
'import/named': 'off',
'import/namespace': 'off',
'import/default': 'off',
'import/no-unresolved': 'off',
'import/no-named-as-default-member': 'off',
'import/no-named-as-default': 'off',
'import/no-cycle': 'off',
'import/no-unused-modules': 'off',
'import/no-deprecated': 'off',
'turbo/no-undeclared-env-vars': 'off', 'turbo/no-undeclared-env-vars': 'off',
'@typescript-eslint/array-type': 'off', '@typescript-eslint/array-type': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off', '@typescript-eslint/no-unsafe-assignment': 'off',
@@ -62,10 +42,6 @@ export default tsEsLint.config(
'error', 'error',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' }, { argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
], ],
'@typescript-eslint/no-misused-promises': [
2,
{ checksVoidReturn: { attributes: false } },
],
'no-restricted-imports': [ 'no-restricted-imports': [
'error', 'error',
{ {
@@ -84,7 +60,8 @@ export default tsEsLint.config(
ignores: [ ignores: [
'**/node_modules', '**/node_modules',
'**/database.types.ts', '**/database.types.ts',
'.next', '**/.next',
'**/public',
'dist', 'dist',
'pnpm-lock.yaml', 'pnpm-lock.yaml',
], ],

View File

@@ -1,3 +0,0 @@
import eslint from '@eslint/js';
export default [eslint.configs.recommended];

View File

@@ -6,9 +6,10 @@ const compat = new FlatCompat({
const nextEslintConfig = [ const nextEslintConfig = [
...compat.config({ ...compat.config({
extends: ['next/core-web-vitals', 'next/typescript'], extends: ['plugin:@next/next/recommended'],
rules: { rules: {
'@next/next/no-html-link-for-pages': 'off', '@next/next/no-html-link-for-pages': 'off',
'no-undef': 'off'
}, },
}), }),
]; ];

View File

@@ -10,23 +10,19 @@
], ],
"scripts": { "scripts": {
"clean": "rm -rf .turbo node_modules", "clean": "rm -rf .turbo node_modules",
"lint": "eslint .",
"format": "prettier --check \"**/*.{js,json}\"" "format": "prettier --check \"**/*.{js,json}\""
}, },
"dependencies": { "dependencies": {
"@next/eslint-plugin-next": "15.1.7", "@next/eslint-plugin-next": "15.1.7",
"@types/eslint": "9.6.1", "@types/eslint": "9.6.1",
"eslint-config-next": "15.1.7", "eslint-config-next": "15.1.7",
"eslint-config-prettier": "^10.0.1",
"eslint-config-turbo": "^2.4.1", "eslint-config-turbo": "^2.4.1",
"eslint-plugin-react": "7.37.4",
"eslint-plugin-react-hooks": "^5.1.0",
"typescript-eslint": "8.24.0" "typescript-eslint": "8.24.0"
}, },
"devDependencies": { "devDependencies": {
"@kit/prettier-config": "workspace:*", "@kit/prettier-config": "workspace:*",
"@kit/tsconfig": "workspace:*", "@kit/tsconfig": "workspace:*",
"eslint": "^9.20.0", "eslint": "^9.20.1",
"typescript": "^5.7.3" "typescript": "^5.7.3"
}, },
"prettier": "@kit/prettier-config" "prettier": "@kit/prettier-config"

View File

@@ -25,6 +25,6 @@ export function checkPendingMigrations() {
console.log('\x1b[32m%s\x1b[0m', '✅ All migrations are up to date.'); console.log('\x1b[32m%s\x1b[0m', '✅ All migrations are up to date.');
} }
} catch (error) { } catch (error) {
console.log('\x1b[33m%s\x1b[0m', '⚠️ Migrations: No remote Supabase project found, we could not check pending migrations. This is normal if you have not yet have linked your Supabase project. Feel free to ignore this message.'); console.log('\x1b[33m%s\x1b[0m', '💡 Info: Project not yet linked to a remote Supabase project. Migration checks skipped - this is expected for new projects. Link your project when you\'re ready to sync with Supabase.\n');
} }
} }