diff --git a/apps/demo/.eslintignore b/apps/demo/.eslintignore new file mode 100644 index 0000000..db4c6d9 --- /dev/null +++ b/apps/demo/.eslintignore @@ -0,0 +1,2 @@ +dist +node_modules \ No newline at end of file diff --git a/apps/demo/.eslintrc.cjs b/apps/demo/.eslintrc.cjs new file mode 100644 index 0000000..2ce75c4 --- /dev/null +++ b/apps/demo/.eslintrc.cjs @@ -0,0 +1,5 @@ +/** @type {import("@types/eslint").Linter.Config} */ +module.exports = { + root: true, + extends: ['@astro-reactive/eslint-config-custom'], +}; diff --git a/apps/demo/.prettierrc.cjs b/apps/demo/.prettierrc.cjs new file mode 100644 index 0000000..0e9c748 --- /dev/null +++ b/apps/demo/.prettierrc.cjs @@ -0,0 +1,24 @@ +/** @type {import("@types/prettier").Options} */ +module.exports = { + printWidth: 100, + semi: true, + singleQuote: true, + tabWidth: 2, + trailingComma: 'es5', + useTabs: true, + plugins: ['../../node_modules/prettier-plugin-astro'], + overrides: [ + { + files: '*.astro', + options: { + parser: 'astro', + }, + }, + { + files: ['.*', '*.json', '*.md', '*.toml', '*.yml'], + options: { + useTabs: false, + }, + }, + ], +}; diff --git a/apps/demo/README.md b/apps/demo/README.md index 0e23d61..42c2d31 100644 --- a/apps/demo/README.md +++ b/apps/demo/README.md @@ -5,4 +5,3 @@ Start the dev server by running: `npm start` 👉 _[Join our contributors!](https://github.com/astro-reactive/astro-reactive/blob/main/CONTRIBUTING.md)_ - diff --git a/apps/demo/astro.config.mjs b/apps/demo/astro.config.mjs index 4840250..882e651 100644 --- a/apps/demo/astro.config.mjs +++ b/apps/demo/astro.config.mjs @@ -1,4 +1,4 @@ -import { defineConfig } from "astro/config"; +import { defineConfig } from 'astro/config'; // https://astro.build/config export default defineConfig({}); diff --git a/apps/demo/package.json b/apps/demo/package.json index 9f061b8..c65fc38 100644 --- a/apps/demo/package.json +++ b/apps/demo/package.json @@ -12,10 +12,12 @@ "build": "astro build", "preview": "astro preview", "astro": "astro", + "format": "prettier -w .", + "lint": "eslint . --ext .ts,.js", + "lint:fix": "eslint --fix . --ext .ts,.js", "clean": "rimraf node_modules .turbo dist" }, "dependencies": { - "@astro-reactive/tsconfig": "*", "@astro-reactive/form": "*", "@astro-reactive/validator": "*", "astro": "^1.6.5" @@ -31,7 +33,13 @@ }, "homepage": "https://github.com/astro-reactive/astro-reactive#readme", "devDependencies": { + "@astro-reactive/eslint-config-custom": "*", + "@astro-reactive/tsconfig": "*", + "@types/eslint": "^8.4.10", + "@types/prettier": "^2.7.2", + "eslint": "^8.31.0", + "prettier": "^2.8.3", + "prettier-plugin-astro": "^0.7.2", "rimraf": "^3.0.2" } } - diff --git a/apps/demo/src/components/Layout.astro b/apps/demo/src/components/Layout.astro index ffeda21..70892e5 100644 --- a/apps/demo/src/components/Layout.astro +++ b/apps/demo/src/components/Layout.astro @@ -1,30 +1,30 @@ --- -import Nav from "./Nav.astro"; +import Nav from './Nav.astro'; export interface Props { - title: string; - theme?: "dark" | "light"; + title: string; + theme?: 'dark' | 'light'; } -const { theme = "light", title } = Astro.props; +const { theme = 'light', title } = Astro.props; --- - - - - - - {title} | Astro Reactive Demo - - -