mirror of
https://github.com/theoludwig/theoludwig.git
synced 2025-05-29 22:37:44 +02:00
chore: cleaner setup
This commit is contained in:
35
configs/config-eslint/eslint.config.js
Normal file
35
configs/config-eslint/eslint.config.js
Normal file
@ -0,0 +1,35 @@
|
||||
import typescriptESLint from "typescript-eslint"
|
||||
import configConventions from "eslint-config-conventions"
|
||||
import importX from "eslint-plugin-import-x"
|
||||
|
||||
export default typescriptESLint.config(
|
||||
{
|
||||
ignores: [
|
||||
".next",
|
||||
"**/next.config.js",
|
||||
"**/eslint.config.js",
|
||||
"**/tailwind.config.js",
|
||||
"**/postcss.config.js",
|
||||
"**/kysely.config.ts",
|
||||
],
|
||||
},
|
||||
...configConventions,
|
||||
{
|
||||
name: "config-eslint",
|
||||
plugins: {
|
||||
"import-x": importX,
|
||||
},
|
||||
rules: {
|
||||
"import-x/extensions": [
|
||||
"error",
|
||||
"ignorePackages",
|
||||
{
|
||||
ts: "always",
|
||||
tsx: "always",
|
||||
js: "never",
|
||||
jsx: "never",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
)
|
7
configs/config-eslint/index.d.ts
vendored
Normal file
7
configs/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
|
61
configs/config-eslint/nextjs/eslint.config.js
Normal file
61
configs/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.",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
)
|
34
configs/config-eslint/package.json
Normal file
34
configs/config-eslint/package.json
Normal file
@ -0,0 +1,34 @@
|
||||
{
|
||||
"name": "@repo/config-eslint",
|
||||
"version": "0.0.0-develop",
|
||||
"private": true,
|
||||
"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": {
|
||||
"@eslint/eslintrc": "catalog:",
|
||||
"typescript-eslint": "catalog:",
|
||||
"eslint": "catalog:",
|
||||
"eslint-config-conventions": "catalog:",
|
||||
"eslint-plugin-promise": "catalog:",
|
||||
"eslint-plugin-unicorn": "catalog:",
|
||||
"eslint-config-next": "catalog:",
|
||||
"eslint-plugin-storybook": "catalog:",
|
||||
"eslint-plugin-tailwindcss": "catalog:",
|
||||
"eslint-plugin-import-x": "catalog:",
|
||||
"typescript": "catalog:",
|
||||
"globals": "catalog:"
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user