Added Prettier&Linter
This commit is contained in:
12
.prettierrc
Normal file
12
.prettierrc
Normal 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"
|
||||||
|
}
|
||||||
@@ -1,18 +1,31 @@
|
|||||||
import { defineConfig, globalIgnores } from "eslint/config";
|
import { defineConfig, globalIgnores } from 'eslint/config';
|
||||||
import nextVitals from "eslint-config-next/core-web-vitals";
|
import nextVitals from 'eslint-config-next/core-web-vitals';
|
||||||
import nextTs from "eslint-config-next/typescript";
|
import nextTs from 'eslint-config-next/typescript';
|
||||||
|
import eslintConfigPrettier from 'eslint-config-prettier';
|
||||||
|
import * as mdx from 'eslint-plugin-mdx';
|
||||||
|
|
||||||
const eslintConfig = defineConfig([
|
const eslintConfig = defineConfig([
|
||||||
...nextVitals,
|
...nextVitals,
|
||||||
...nextTs,
|
...nextTs,
|
||||||
|
{
|
||||||
|
files: ['**/*.mdoc', '**/*.markdoc'],
|
||||||
|
plugins: {
|
||||||
|
mdx: mdx,
|
||||||
|
},
|
||||||
|
processor: 'mdx/remark',
|
||||||
|
rules: {
|
||||||
|
'@typescript-eslint/no-unused-vars': 'off',
|
||||||
|
},
|
||||||
|
},
|
||||||
// Override default ignores of eslint-config-next.
|
// Override default ignores of eslint-config-next.
|
||||||
globalIgnores([
|
globalIgnores([
|
||||||
// Default ignores of eslint-config-next:
|
// Default ignores of eslint-config-next:
|
||||||
".next/**",
|
'.next/**',
|
||||||
"out/**",
|
'out/**',
|
||||||
"build/**",
|
'build/**',
|
||||||
"next-env.d.ts",
|
'next-env.d.ts',
|
||||||
]),
|
]),
|
||||||
|
eslintConfigPrettier,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
export default eslintConfig;
|
export default eslintConfig;
|
||||||
|
|||||||
@@ -4,5 +4,5 @@ export default config({
|
|||||||
storage: {
|
storage: {
|
||||||
kind: 'local',
|
kind: 'local',
|
||||||
},
|
},
|
||||||
collections: {}
|
collections: {},
|
||||||
})
|
});
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { NextConfig } from "next";
|
import type { NextConfig } from 'next';
|
||||||
|
|
||||||
const nextConfig: NextConfig = {
|
const nextConfig: NextConfig = {
|
||||||
/* config options here */
|
/* config options here */
|
||||||
|
|||||||
10
package.json
10
package.json
@@ -6,12 +6,15 @@
|
|||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
"start": "next start",
|
"start": "next start",
|
||||||
"lint": "eslint"
|
"lint": "eslint",
|
||||||
|
"format": "prettier --write ."
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@keystatic/core": "^0.5.48",
|
"@keystatic/core": "^0.5.48",
|
||||||
"@keystatic/next": "^5.0.4",
|
"@keystatic/next": "^5.0.4",
|
||||||
"@markdoc/markdoc": "^0.5.4",
|
"@markdoc/markdoc": "^0.5.4",
|
||||||
|
"eslint-config-prettier": "^10.1.8",
|
||||||
|
"eslint-plugin-mdx": "^3.6.2",
|
||||||
"next": "16.0.1",
|
"next": "16.0.1",
|
||||||
"react": "19.2.0",
|
"react": "19.2.0",
|
||||||
"react-dom": "19.2.0"
|
"react-dom": "19.2.0"
|
||||||
@@ -22,6 +25,11 @@
|
|||||||
"@types/react-dom": "^19",
|
"@types/react-dom": "^19",
|
||||||
"eslint": "^9",
|
"eslint": "^9",
|
||||||
"eslint-config-next": "16.0.1",
|
"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"
|
"typescript": "^5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
1481
pnpm-lock.yaml
generated
1481
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
import { makeRouteHandler } from "@keystatic/next/route-handler";
|
import { makeRouteHandler } from '@keystatic/next/route-handler';
|
||||||
import { config } from '~/keystatic.config'
|
import { config } from '~/keystatic.config';
|
||||||
|
|
||||||
export const { POST, GET } = makeRouteHandler({
|
export const { POST, GET } = makeRouteHandler({
|
||||||
config
|
config,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
"use client";
|
'use client';
|
||||||
|
|
||||||
import { makePage } from "@keystatic/next/ui/app";
|
import { makePage } from '@keystatic/next/ui/app';
|
||||||
import config from "~/keystatic.config"
|
import config from '~/keystatic.config';
|
||||||
|
|
||||||
export default makePage(config);
|
export default makePage(config);
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
import KeystaticApp from "./keystatic";
|
import KeystaticApp from './keystatic';
|
||||||
|
|
||||||
export default function Layout() {
|
export default function Layout() {
|
||||||
return (
|
return <KeystaticApp />;
|
||||||
<KeystaticApp />
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import Image from "next/image";
|
import Image from 'next/image';
|
||||||
import styles from "./page.module.css";
|
import styles from './page.module.css';
|
||||||
|
|
||||||
export default function Home() {
|
export default function Home() {
|
||||||
return (
|
return (
|
||||||
@@ -16,22 +16,22 @@ export default function Home() {
|
|||||||
<div className={styles.intro}>
|
<div className={styles.intro}>
|
||||||
<h1>To get started, edit the page.tsx file.</h1>
|
<h1>To get started, edit the page.tsx file.</h1>
|
||||||
<p>
|
<p>
|
||||||
Looking for a starting point or more instructions? Head over to{" "}
|
Looking for a starting point or more instructions? Head over to{' '}
|
||||||
<a
|
<a
|
||||||
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
|
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"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
>
|
>
|
||||||
Templates
|
Templates
|
||||||
</a>{" "}
|
</a>{' '}
|
||||||
or the{" "}
|
or the{' '}
|
||||||
<a
|
<a
|
||||||
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
|
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
>
|
>
|
||||||
Learning
|
Learning
|
||||||
</a>{" "}
|
</a>{' '}
|
||||||
center.
|
center.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,20 +1,20 @@
|
|||||||
import type { Metadata } from "next";
|
import type { Metadata } from 'next';
|
||||||
import { Geist, Geist_Mono } from "next/font/google";
|
import { Geist, Geist_Mono } from 'next/font/google';
|
||||||
import "./globals.css";
|
import './globals.css';
|
||||||
|
|
||||||
const geistSans = Geist({
|
const geistSans = Geist({
|
||||||
variable: "--font-geist-sans",
|
variable: '--font-geist-sans',
|
||||||
subsets: ["latin"],
|
subsets: ['latin'],
|
||||||
});
|
});
|
||||||
|
|
||||||
const geistMono = Geist_Mono({
|
const geistMono = Geist_Mono({
|
||||||
variable: "--font-geist-mono",
|
variable: '--font-geist-mono',
|
||||||
subsets: ["latin"],
|
subsets: ['latin'],
|
||||||
});
|
});
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: "Create Next App",
|
title: 'Create Next App',
|
||||||
description: "Generated by create next app",
|
description: 'Generated by create next app',
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function RootLayout({
|
export default function RootLayout({
|
||||||
|
|||||||
13
stylelint.config.mjs
Normal file
13
stylelint.config.mjs
Normal 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],
|
||||||
|
};
|
||||||
@@ -1,11 +1,7 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "ES2017",
|
"target": "ES2017",
|
||||||
"lib": [
|
"lib": ["dom", "dom.iterable", "esnext"],
|
||||||
"dom",
|
|
||||||
"dom.iterable",
|
|
||||||
"esnext"
|
|
||||||
],
|
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"strict": true,
|
"strict": true,
|
||||||
@@ -23,12 +19,8 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"paths": {
|
"paths": {
|
||||||
"@/*": [
|
"@/*": ["./src/*"],
|
||||||
"./src/*"
|
"~/*": ["./*"]
|
||||||
],
|
|
||||||
"~/*": [
|
|
||||||
"./*"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
@@ -39,7 +31,5 @@
|
|||||||
".next/dev/types/**/*.ts",
|
".next/dev/types/**/*.ts",
|
||||||
"**/*.mts"
|
"**/*.mts"
|
||||||
],
|
],
|
||||||
"exclude": [
|
"exclude": ["node_modules"]
|
||||||
"node_modules"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user