Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 52 additions & 7 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/** @type {import("@types/eslint").Linter.Config} */
// Extracted from `webdev-configs` (https://github.com/JulianCataldo/web-garden/tree/develop/configs)

module.exports = {
root: true,
Expand All @@ -15,8 +14,30 @@ module.exports = {
browser: true,
node: true,
},

files: ["*.ts", "*.tsx"],
parser: "typescript-eslint-parser-for-extra-files",
parserOptions: {
project: "./your/tsconfig.json"
// ....
},
},
{
files: ["*.svelte"],
parser: "svelte-eslint-parser",
parserOptions: {
parser: require("typescript-eslint-parser-for-extra-files"),
// Or
// "parser": {
// "ts": require("typescript-eslint-parser-for-extra-files")
// }
project: "./tsconfig.json"

},

overrides: [


/* — TS — */
{
files: ['*.ts', '*.mts', '*.cts'],
Expand All @@ -26,7 +47,8 @@ module.exports = {
'@typescript-eslint',
],

parser: '@typescript-eslint/parser',
parser:
'@typescript-eslint/parser',
parserOptions: {
project: ['./tsconfig.json'] /* Specify it only for TypeScript files */,
ecmaVersion: 'latest',
Expand All @@ -36,14 +58,19 @@ module.exports = {
extends: [
'airbnb-base',
'airbnb-typescript',

'plugin:astro/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:@typescript-eslint/strict',

'eslint:recommended',
'prettier',
],

"overrides": [
{
"files": ["*.astro"],
"parser": "astro-eslint-parser"
}
],
rules: {
'tsdoc/syntax': 'warn',
'@typescript-eslint/no-unused-vars': [
Expand Down Expand Up @@ -92,12 +119,14 @@ module.exports = {
parserOptions: {
/* Prevents "unresolved" when using "paths" */
// project: ['./tsconfig.json'],
parser: '@typescript-eslint/parser',
extraFileExtensions: ['.astro'],
parser: "@typescript-eslint/parser",
extraFileExtensions: [".astro"],
},
rules: {
'import/no-absolute-path': 'off',
/* ESLint won't capture ambient declarations in Astro files. */
"astro/no-conflict-set-directives": "error",
"astro/no-unused-define-vars-in-style": "error",
'no-undef': 'off',
'import/extensions': 'off',
'import/no-named-as-default-member': 'off',
Expand All @@ -124,5 +153,21 @@ module.exports = {
astroHTML: 'readonly',
},
},

{
files: ["**/*.astro/*.js", "*.astro/*.js"],
env: {
browser: true,
es2020: true,
},
parserOptions: {
sourceType: "module",
},
rules: {
"prettier/prettier": "off",
},

},
],

};
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "@brucesong/eslint-config-astro"
}
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# build output
dist/

# generated types
.astro/
/strapi
/.vscode

# dependencies
node_modules/
Expand All @@ -13,13 +14,13 @@ yarn-debug.log*
yarn-error.log*
pnpm-debug.log*


# environment variables
.env
.env.production

# macOS-specific files
.DS_Store


# misc.
.dev*
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18.17.1
2 changes: 2 additions & 0 deletions .prettierrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ module.exports = {
useTabs: true,

plugins: ['./node_modules/prettier-plugin-astro'],
autoprefixer: {},
tailwindcss: {},
overrides: [
{
files: '*.astro',
Expand Down
7 changes: 6 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@
"javascript",
"javascriptreact",
"typescript",
"typescriptreact"
"typescriptreact",
],
"editor.codeActionsOnSave": {
"source.fixAll": false,
"source.fixAll.eslint": true,
"source.organizeImports": false
},

/* —————————————————————————————— Prettier ———————————————————————————————— */
/* Add support for `prettier-plugin-astro` */
Expand Down
62 changes: 39 additions & 23 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,30 +1,46 @@
import { defineConfig } from 'astro/config';
import { defineConfig } from "astro/config";
import node from "@astrojs/node";
import solidJs from "@astrojs/solid-js";
import prefetch from "@astrojs/prefetch";
import partytown from "@astrojs/partytown";
import vue from "@astrojs/vue";
import react from "@astrojs/react";
import preact from "@astrojs/preact";
import svelte from "@astrojs/svelte";
import sitemap from "@astrojs/sitemap";
import tailwind from "@astrojs/tailwind";
import yaml from "@rollup/plugin-yaml";

import sitemap from '@astrojs/sitemap';
import tailwind from '@astrojs/tailwind';

const DEV_PORT = 2121;


// https://astro.build/config
export default defineConfig({
site: process.env.CI
? 'https://themesberg.github.io'
: `http://localhost:${DEV_PORT}`,
base: process.env.CI ? '/flowbite-astro-admin-dashboard' : undefined,

// output: 'server',

/* Like Vercel, Netlify,… Mimicking for dev. server */
// trailingSlash: 'always',

server: {
/* Dev. server only */
port: DEV_PORT,
},

integrations: [
//
sitemap(),
tailwind(),
],
site: process.env.CI ? 'https://devopsick.com' : `http://localhost:${DEV_PORT}`,
base: process.env.CI ? '/flowbite-astro-admin-dashboard' : undefined,
output: "server",
adapter: node({
mode: "standalone"
}),
vite: {
ssr: {
external: ["svgo"],
},
plugins: [yaml()],
},
integrations: [
//
sitemap(), tailwind(), prefetch(), partytown(), vue(),
preact({
include: ['**/preact/*'],
}),
react({
include: ['**/react/*'],
}),
solidJs({
include: ['**/solidJs/*'],
}),
svelte({ preprocess: [] })],

});
Loading