mirror of
https://github.com/theoludwig/theoludwig.git
synced 2025-05-29 22:37:44 +02:00
build(deps): update Next.js to v15 and ESLint to v9
This commit is contained in:
@ -1,26 +0,0 @@
|
||||
{
|
||||
"extends": ["conventions"],
|
||||
"plugins": ["import-x"],
|
||||
"rules": {
|
||||
"import-x/no-absolute-path": "error",
|
||||
"import-x/no-webpack-loader-syntax": "error",
|
||||
"import-x/no-self-import": "error",
|
||||
"import-x/no-useless-path-segments": "error",
|
||||
"import-x/export": "error",
|
||||
"import-x/no-duplicates": "error",
|
||||
"import-x/no-named-default": "error",
|
||||
"import-x/no-empty-named-blocks": "error",
|
||||
"import-x/no-anonymous-default-export": "error",
|
||||
"import-x/extensions": [
|
||||
"error",
|
||||
"ignorePackages",
|
||||
{
|
||||
"ts": "always",
|
||||
"tsx": "always",
|
||||
"js": "never",
|
||||
"jsx": "never"
|
||||
}
|
||||
],
|
||||
"import-x/consistent-type-specifier-style": ["error", "prefer-top-level"]
|
||||
}
|
||||
}
|
40
packages/config-eslint/eslint.config.js
Normal file
40
packages/config-eslint/eslint.config.js
Normal file
@ -0,0 +1,40 @@
|
||||
import typescriptESLint from "typescript-eslint"
|
||||
import configConventions from "eslint-config-conventions"
|
||||
import importX from "eslint-plugin-import-x"
|
||||
import unicorn from "eslint-plugin-unicorn"
|
||||
|
||||
export default typescriptESLint.config(
|
||||
{
|
||||
ignores: [
|
||||
".next",
|
||||
"**/next.config.js",
|
||||
"**/eslint.config.js",
|
||||
"**/tailwind.config.js",
|
||||
"**/postcss.config.js",
|
||||
"**/vitest.config.ts",
|
||||
"**/kysely.config.ts",
|
||||
],
|
||||
},
|
||||
...configConventions,
|
||||
{
|
||||
name: "config-eslint",
|
||||
plugins: {
|
||||
"import-x": importX,
|
||||
unicorn,
|
||||
},
|
||||
rules: {
|
||||
"import-x/extensions": [
|
||||
"error",
|
||||
"ignorePackages",
|
||||
{
|
||||
ts: "always",
|
||||
tsx: "always",
|
||||
js: "never",
|
||||
jsx: "never",
|
||||
},
|
||||
],
|
||||
"unicorn/explicit-length-check": "error",
|
||||
"unicorn/consistent-destructuring": "off",
|
||||
},
|
||||
},
|
||||
)
|
7
packages/config-eslint/index.d.ts
vendored
Normal file
7
packages/config-eslint/index.d.ts
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
import type typescriptESLint from "typescript-eslint"
|
||||
|
||||
declare const eslintConfigConventions: ReturnType<
|
||||
typeof typescriptESLint.config
|
||||
>
|
||||
|
||||
export default eslintConfigConventions
|
@ -1,57 +0,0 @@
|
||||
{
|
||||
"extends": [
|
||||
"../.eslintrc.json",
|
||||
"next/core-web-vitals",
|
||||
"plugin:tailwindcss/recommended",
|
||||
"plugin:storybook/recommended"
|
||||
],
|
||||
"ignorePatterns": [
|
||||
"next.config.js",
|
||||
"tailwind.config.js",
|
||||
"postcss.config.js",
|
||||
"vitest.config.ts"
|
||||
],
|
||||
"settings": {
|
||||
"tailwindcss": {
|
||||
"callees": ["classNames", "cva"]
|
||||
},
|
||||
"react": {
|
||||
"version": "detect"
|
||||
}
|
||||
},
|
||||
"rules": {
|
||||
"tailwindcss/classnames-order": "off",
|
||||
"tailwindcss/no-custom-classname": "off",
|
||||
"@next/next/no-html-link-for-pages": "off",
|
||||
"react/self-closing-comp": [
|
||||
"error",
|
||||
{
|
||||
"component": true,
|
||||
"html": true
|
||||
}
|
||||
],
|
||||
"react/void-dom-elements-no-children": "error",
|
||||
"react/jsx-boolean-value": "error",
|
||||
"no-restricted-imports": [
|
||||
"error",
|
||||
{
|
||||
"paths": [
|
||||
{
|
||||
"name": "next/link",
|
||||
"message": "Please import from `@repo/i18n/navigation` instead."
|
||||
},
|
||||
{
|
||||
"name": "next/navigation",
|
||||
"importNames": [
|
||||
"redirect",
|
||||
"permanentRedirect",
|
||||
"useRouter",
|
||||
"usePathname"
|
||||
],
|
||||
"message": "Please import from `@repo/i18n/navigation` instead."
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
61
packages/config-eslint/nextjs/eslint.config.js
Normal file
61
packages/config-eslint/nextjs/eslint.config.js
Normal file
@ -0,0 +1,61 @@
|
||||
import { FlatCompat } from "@eslint/eslintrc"
|
||||
import storybook from "eslint-plugin-storybook"
|
||||
import tailwind from "eslint-plugin-tailwindcss"
|
||||
import typescriptESLint from "typescript-eslint"
|
||||
import config from "../eslint.config.js"
|
||||
|
||||
const flatCompat = new FlatCompat()
|
||||
|
||||
export default typescriptESLint.config(
|
||||
...config,
|
||||
...flatCompat.extends("next/core-web-vitals"),
|
||||
...tailwind.configs["flat/recommended"],
|
||||
...storybook.configs["flat/recommended"],
|
||||
{
|
||||
name: "config-eslint/nextjs",
|
||||
settings: {
|
||||
tailwindcss: {
|
||||
callees: ["classNames", "cva"],
|
||||
},
|
||||
react: {
|
||||
version: "detect",
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
"tailwindcss/classnames-order": "off",
|
||||
"tailwindcss/no-custom-classname": "off",
|
||||
"@next/next/no-html-link-for-pages": "off",
|
||||
"@next/next/no-img-element": "off",
|
||||
"react/self-closing-comp": [
|
||||
"error",
|
||||
{
|
||||
component: true,
|
||||
html: true,
|
||||
},
|
||||
],
|
||||
"react/void-dom-elements-no-children": "error",
|
||||
"react/jsx-boolean-value": "error",
|
||||
"no-restricted-imports": [
|
||||
"error",
|
||||
{
|
||||
paths: [
|
||||
{
|
||||
name: "next/link",
|
||||
message: "Please import from `@repo/i18n/routing` instead.",
|
||||
},
|
||||
{
|
||||
name: "next/navigation",
|
||||
importNames: [
|
||||
"redirect",
|
||||
"permanentRedirect",
|
||||
"useRouter",
|
||||
"usePathname",
|
||||
],
|
||||
message: "Please import from `@repo/i18n/routing` instead.",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
)
|
@ -2,14 +2,24 @@
|
||||
"name": "@repo/eslint-config",
|
||||
"version": "4.0.0",
|
||||
"private": true,
|
||||
"main": ".eslintrc.json",
|
||||
"files": [
|
||||
".eslintrc.json",
|
||||
"nextjs/.eslintrc.json"
|
||||
],
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./index.d.ts",
|
||||
"import": "./eslint.config.js",
|
||||
"require": "./eslint.config.js",
|
||||
"default": "./eslint.config.js"
|
||||
},
|
||||
"./nextjs": {
|
||||
"types": "./index.d.ts",
|
||||
"import": "./nextjs/eslint.config.js",
|
||||
"require": "./nextjs/eslint.config.js",
|
||||
"default": "./nextjs/eslint.config.js"
|
||||
}
|
||||
},
|
||||
"devDependencies": {
|
||||
"@typescript-eslint/eslint-plugin": "catalog:",
|
||||
"@typescript-eslint/parser": "catalog:",
|
||||
"@eslint/eslintrc": "catalog:",
|
||||
"typescript-eslint": "catalog:",
|
||||
"eslint": "catalog:",
|
||||
"eslint-config-conventions": "catalog:",
|
||||
"eslint-plugin-promise": "catalog:",
|
||||
@ -18,6 +28,7 @@
|
||||
"eslint-plugin-storybook": "catalog:",
|
||||
"eslint-plugin-tailwindcss": "catalog:",
|
||||
"eslint-plugin-import-x": "catalog:",
|
||||
"typescript": "catalog:"
|
||||
"typescript": "catalog:",
|
||||
"globals": "catalog:"
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user