Added Prettier&Linter

This commit is contained in:
2025-11-12 12:58:15 +01:00
parent b18d8d6477
commit 9cecb48d34
13 changed files with 1565 additions and 50 deletions

12
.prettierrc Normal file
View File

@@ -0,0 +1,12 @@
{
"semi": true,
"trailingComma": "es5",
"singleQuote": true,
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"endOfLine": "lf",
"bracketSpacing": true,
"bracketSameLine": false,
"arrowParens": "always"
}

View File

@@ -1,18 +1,31 @@
import { defineConfig, globalIgnores } from "eslint/config";
import nextVitals from "eslint-config-next/core-web-vitals";
import nextTs from "eslint-config-next/typescript";
import { defineConfig, globalIgnores } from 'eslint/config';
import nextVitals from 'eslint-config-next/core-web-vitals';
import nextTs from 'eslint-config-next/typescript';
import eslintConfigPrettier from 'eslint-config-prettier';
import * as mdx from 'eslint-plugin-mdx';
const eslintConfig = defineConfig([
...nextVitals,
...nextTs,
{
files: ['**/*.mdoc', '**/*.markdoc'],
plugins: {
mdx: mdx,
},
processor: 'mdx/remark',
rules: {
'@typescript-eslint/no-unused-vars': 'off',
},
},
// Override default ignores of eslint-config-next.
globalIgnores([
// Default ignores of eslint-config-next:
".next/**",
"out/**",
"build/**",
"next-env.d.ts",
'.next/**',
'out/**',
'build/**',
'next-env.d.ts',
]),
eslintConfigPrettier,
]);
export default eslintConfig;

View File

@@ -4,5 +4,5 @@ export default config({
storage: {
kind: 'local',
},
collections: {}
})
collections: {},
});

View File

@@ -1,4 +1,4 @@
import type { NextConfig } from "next";
import type { NextConfig } from 'next';
const nextConfig: NextConfig = {
/* config options here */

View File

@@ -6,12 +6,15 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "eslint"
"lint": "eslint",
"format": "prettier --write ."
},
"dependencies": {
"@keystatic/core": "^0.5.48",
"@keystatic/next": "^5.0.4",
"@markdoc/markdoc": "^0.5.4",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-mdx": "^3.6.2",
"next": "16.0.1",
"react": "19.2.0",
"react-dom": "19.2.0"
@@ -22,6 +25,11 @@
"@types/react-dom": "^19",
"eslint": "^9",
"eslint-config-next": "16.0.1",
"prettier": "^3.6.2",
"stylelint": "^16.25.0",
"stylelint-config-clean-order": "^7.0.0",
"stylelint-config-html": "^1.1.0",
"stylelint-config-standard": "^39.0.1",
"typescript": "^5"
}
}

1481
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
import { makeRouteHandler } from "@keystatic/next/route-handler";
import { config } from '~/keystatic.config'
import { makeRouteHandler } from '@keystatic/next/route-handler';
import { config } from '~/keystatic.config';
export const { POST, GET } = makeRouteHandler({
config
config,
});

View File

@@ -1,6 +1,6 @@
"use client";
'use client';
import { makePage } from "@keystatic/next/ui/app";
import config from "~/keystatic.config"
import { makePage } from '@keystatic/next/ui/app';
import config from '~/keystatic.config';
export default makePage(config);

View File

@@ -1,7 +1,5 @@
import KeystaticApp from "./keystatic";
import KeystaticApp from './keystatic';
export default function Layout() {
return (
<KeystaticApp />
);
return <KeystaticApp />;
}

View File

@@ -1,5 +1,5 @@
import Image from "next/image";
import styles from "./page.module.css";
import Image from 'next/image';
import styles from './page.module.css';
export default function Home() {
return (
@@ -16,22 +16,22 @@ export default function Home() {
<div className={styles.intro}>
<h1>To get started, edit the page.tsx file.</h1>
<p>
Looking for a starting point or more instructions? Head over to{" "}
Looking for a starting point or more instructions? Head over to{' '}
<a
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
Templates
</a>{" "}
or the{" "}
</a>{' '}
or the{' '}
<a
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
Learning
</a>{" "}
</a>{' '}
center.
</p>
</div>

View File

@@ -1,20 +1,20 @@
import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import "./globals.css";
import type { Metadata } from 'next';
import { Geist, Geist_Mono } from 'next/font/google';
import './globals.css';
const geistSans = Geist({
variable: "--font-geist-sans",
subsets: ["latin"],
variable: '--font-geist-sans',
subsets: ['latin'],
});
const geistMono = Geist_Mono({
variable: "--font-geist-mono",
subsets: ["latin"],
variable: '--font-geist-mono',
subsets: ['latin'],
});
export const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app",
title: 'Create Next App',
description: 'Generated by create next app',
};
export default function RootLayout({

13
stylelint.config.mjs Normal file
View File

@@ -0,0 +1,13 @@
const stylelintConfig = {
extends: [
'stylelint-config-standard',
'stylelint-config-clean-order',
'stylelint-config-html',
],
rules: {
'declaration-block-no-redundant-longhand-properties': null,
'no-descemdomg-specificity': null,
'selector-class-pattern': null,
},
'at-rule-no-unknown': [true],
};

View File

@@ -1,11 +1,7 @@
{
"compilerOptions": {
"target": "ES2017",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
@@ -23,12 +19,8 @@
}
],
"paths": {
"@/*": [
"./src/*"
],
"~/*": [
"./*"
]
"@/*": ["./src/*"],
"~/*": ["./*"]
}
},
"include": [
@@ -39,7 +31,5 @@
".next/dev/types/**/*.ts",
"**/*.mts"
],
"exclude": [
"node_modules"
]
"exclude": ["node_modules"]
}