@tuqulore-inc/create-eleventy 5.1.0 → 5.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1 -1
- package/package.json +11 -11
- package/templates/default/Dockerfile +3 -3
- package/templates/default/README.md +2 -7
- package/templates/default/_oxfmtrc.json +5 -0
- package/templates/default/_oxlintrc.json +27 -0
- package/templates/default/_vscode/extensions.json +1 -1
- package/templates/default/_vscode/settings.json +4 -3
- package/templates/default/package.json +6 -13
- package/templates/default/serve.js +2 -1
- package/templates/default/src/__includes/partials/header/desktop.client.jsx +14 -18
- package/templates/default/src/__includes/partials/header/mobile.client.jsx +26 -23
- package/templates/default/src/__includes/partials/header.mdx +2 -7
- package/templates/default/src/__includes/partials/ogp.mdx +4 -16
- package/templates/default/src/__includes/post.mdx +4 -4
- package/templates/default/src/clicker.client.jsx +2 -6
- package/templates/default/src/index.mdx +7 -7
- package/templates/default/_prettierignore +0 -1
- package/templates/default/eslint.config.js +0 -56
- package/templates/default/prettier.config.js +0 -4
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tuqulore-inc/create-eleventy",
|
|
3
|
-
"version": "5.1
|
|
3
|
+
"version": "5.2.1",
|
|
4
4
|
"description": "Create a new Eleventy project with Preact and TailwindCSS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"create",
|
|
@@ -8,14 +8,13 @@
|
|
|
8
8
|
"preact",
|
|
9
9
|
"tailwindcss"
|
|
10
10
|
],
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"author": "tuqulore inc.",
|
|
11
13
|
"repository": {
|
|
12
14
|
"type": "git",
|
|
13
15
|
"url": "git+https://github.com/tuqulore/website-boilerplate.git",
|
|
14
16
|
"directory": "packages/create-eleventy"
|
|
15
17
|
},
|
|
16
|
-
"license": "MIT",
|
|
17
|
-
"author": "tuqulore inc.",
|
|
18
|
-
"type": "module",
|
|
19
18
|
"bin": {
|
|
20
19
|
"create-eleventy": "./index.js"
|
|
21
20
|
},
|
|
@@ -23,19 +22,20 @@
|
|
|
23
22
|
"index.js",
|
|
24
23
|
"templates"
|
|
25
24
|
],
|
|
25
|
+
"type": "module",
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
26
29
|
"scripts": {
|
|
27
|
-
"lint": "
|
|
30
|
+
"lint": "oxlint --fix",
|
|
28
31
|
"test": "node --test"
|
|
29
32
|
},
|
|
30
33
|
"devDependencies": {
|
|
31
|
-
"@tuqulore-inc/
|
|
32
|
-
"
|
|
34
|
+
"@tuqulore-inc/oxlint-config": "5.2.1",
|
|
35
|
+
"oxlint": "^1.75.0"
|
|
33
36
|
},
|
|
34
37
|
"engines": {
|
|
35
38
|
"node": ">=20"
|
|
36
39
|
},
|
|
37
|
-
"
|
|
38
|
-
"access": "public"
|
|
39
|
-
},
|
|
40
|
-
"gitHead": "0d43e2a32a951ca608a2c5095c084737b7f3c8bf"
|
|
40
|
+
"gitHead": "01986dae3bcd2732e7f48b0441cda902f7f2258a"
|
|
41
41
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
FROM node:24-slim@sha256:
|
|
1
|
+
FROM node:24-slim@sha256:ba849c60be29959425b8734d57b8b4b7d56f98edd9504c9af091d5281095a71e as build
|
|
2
2
|
WORKDIR /app
|
|
3
3
|
COPY package.json pnpm-lock.yaml ./
|
|
4
4
|
RUN corepack enable
|
|
@@ -7,13 +7,13 @@ COPY postcss.config.js eleventy.config.js .env* ./
|
|
|
7
7
|
COPY src/ ./src
|
|
8
8
|
RUN pnpm build
|
|
9
9
|
|
|
10
|
-
FROM node:24-slim@sha256:
|
|
10
|
+
FROM node:24-slim@sha256:ba849c60be29959425b8734d57b8b4b7d56f98edd9504c9af091d5281095a71e as install
|
|
11
11
|
WORKDIR /app
|
|
12
12
|
COPY package.json pnpm-lock.yaml ./
|
|
13
13
|
RUN corepack enable
|
|
14
14
|
RUN pnpm install --frozen-lockfile --prod
|
|
15
15
|
|
|
16
|
-
FROM gcr.io/distroless/nodejs24-debian13@sha256:
|
|
16
|
+
FROM gcr.io/distroless/nodejs24-debian13@sha256:7cca079bad19303c78cd874a5da79832441985a216b767196507d69b8784a698
|
|
17
17
|
WORKDIR /app
|
|
18
18
|
ENV NODE_ENV=production
|
|
19
19
|
COPY serve.js ./
|
|
@@ -134,18 +134,13 @@ export default clientComponent(Counter, import.meta.url);
|
|
|
134
134
|
import { Island } from "@tuqulore-inc/eleventy-preset/island";
|
|
135
135
|
import Counter from "./counter.client.jsx";
|
|
136
136
|
|
|
137
|
-
<Island component={Counter} on="
|
|
137
|
+
<Island component={Counter} on="visible" initial={5} />
|
|
138
138
|
```
|
|
139
139
|
|
|
140
140
|
For the example above, `<Island>` emits an `<is-land>` element like this from SSR:
|
|
141
141
|
|
|
142
142
|
```html
|
|
143
|
-
<is-land
|
|
144
|
-
land-on:interaction
|
|
145
|
-
type="preact"
|
|
146
|
-
import="/counter.client.js"
|
|
147
|
-
props='{"initial":5}'
|
|
148
|
-
>
|
|
143
|
+
<is-land land-on:visible type="preact" import="/counter.client.js" props='{"initial":5}'>
|
|
149
144
|
<button>5</button>
|
|
150
145
|
</is-land>
|
|
151
146
|
```
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
|
3
|
+
"plugins": ["typescript", "unicorn", "oxc", "react", "jsx-a11y", "import"],
|
|
4
|
+
"categories": {
|
|
5
|
+
"correctness": "error",
|
|
6
|
+
"suspicious": "warn",
|
|
7
|
+
"perf": "warn"
|
|
8
|
+
},
|
|
9
|
+
"env": {
|
|
10
|
+
"browser": true,
|
|
11
|
+
"es2024": true,
|
|
12
|
+
"node": true,
|
|
13
|
+
"serviceworker": true
|
|
14
|
+
},
|
|
15
|
+
"rules": {
|
|
16
|
+
"react/react-in-jsx-scope": "off",
|
|
17
|
+
"react/no-unknown-property": "off",
|
|
18
|
+
"no-underscore-dangle": "off"
|
|
19
|
+
},
|
|
20
|
+
"overrides": [
|
|
21
|
+
{
|
|
22
|
+
"files": ["**/*.cjs"],
|
|
23
|
+
"env": { "commonjs": true }
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"ignorePatterns": ["**/dist/**", "**/node_modules/**", "pnpm-lock.yaml", "**/*.mdx"]
|
|
27
|
+
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"extensions.ignoreRecommendations": false,
|
|
3
|
+
"editor.defaultFormatter": "oxc.oxc-vscode",
|
|
4
|
+
"editor.formatOnSave": false,
|
|
3
5
|
"editor.codeActionsOnSave": {
|
|
4
|
-
"source.
|
|
6
|
+
"source.format.oxc": "always",
|
|
7
|
+
"source.fixAll.oxc": "always"
|
|
5
8
|
},
|
|
6
|
-
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
7
|
-
"editor.formatOnSave": true,
|
|
8
9
|
"css.validate": false,
|
|
9
10
|
"less.validate": false,
|
|
10
11
|
"scss.validate": false
|
|
@@ -7,35 +7,28 @@
|
|
|
7
7
|
"build:eleventy": "dotenv -c production -- eleventy",
|
|
8
8
|
"clean": "shx rm -rf dist",
|
|
9
9
|
"dev": "dotenv -c development -- eleventy --serve",
|
|
10
|
-
"format": "
|
|
11
|
-
"lint": "
|
|
10
|
+
"format": "oxfmt",
|
|
11
|
+
"lint": "oxlint --fix"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"serve-handler": "^6.1.6"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@11ty/eleventy": "^3.1.2",
|
|
18
|
-
"@eslint/js": "^10.0.0",
|
|
19
18
|
"@iconify/json": "^2.2.90",
|
|
20
19
|
"@iconify/tailwind4": "^1.0.6",
|
|
21
|
-
"@jumpu-ui/tailwindcss": "3.0.
|
|
20
|
+
"@jumpu-ui/tailwindcss": "3.0.2",
|
|
22
21
|
"@preact/signals": "^2.9.3",
|
|
23
22
|
"@tailwindcss/postcss": "^4.0.14",
|
|
24
23
|
"@tailwindcss/typography": "0.5.20",
|
|
25
|
-
"@tuqulore-inc/eleventy-preset": "^5.1
|
|
24
|
+
"@tuqulore-inc/eleventy-preset": "^5.2.1",
|
|
26
25
|
"dotenv-cli": "^11.0.0",
|
|
27
|
-
"eslint": "^10.0.0",
|
|
28
|
-
"eslint-config-prettier": "^10.1.8",
|
|
29
|
-
"eslint-plugin-mdx": "^3.2.0",
|
|
30
|
-
"eslint-plugin-react": "^7.37.4",
|
|
31
|
-
"globals": "^17.0.0",
|
|
32
26
|
"npm-run-all2": "^9.0.0",
|
|
27
|
+
"oxfmt": "^0.65.0",
|
|
28
|
+
"oxlint": "^1.75.0",
|
|
33
29
|
"postcss": "^8.5.6",
|
|
34
30
|
"preact": "^10.26.4",
|
|
35
|
-
"prettier": "^3.8.1",
|
|
36
|
-
"prettier-plugin-tailwindcss": "^0.8.0",
|
|
37
31
|
"shx": "^0.4.0",
|
|
38
|
-
"slugify": "^1.6.6",
|
|
39
32
|
"tailwind-merge": "^3.0.2",
|
|
40
33
|
"tailwindcss": "^4.1.18"
|
|
41
34
|
},
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { clientComponent } from "@tuqulore-inc/eleventy-preset/island";
|
|
2
1
|
import { useSignal, useSignalEffect } from "@preact/signals";
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
2
|
+
import { clientComponent } from "@tuqulore-inc/eleventy-preset/island";
|
|
3
|
+
import { useId, useRef } from "preact/hooks";
|
|
5
4
|
import { twMerge } from "tailwind-merge";
|
|
6
5
|
|
|
7
6
|
function MenuList(props) {
|
|
@@ -15,7 +14,7 @@ function MenuList(props) {
|
|
|
15
14
|
};
|
|
16
15
|
const ref = useRef(null);
|
|
17
16
|
const buttonRef = useRef(null);
|
|
18
|
-
const
|
|
17
|
+
const baseId = useId();
|
|
19
18
|
useSignalEffect(() => {
|
|
20
19
|
if (!open.value) return;
|
|
21
20
|
const clickHandler = (e) => {
|
|
@@ -44,9 +43,9 @@ function MenuList(props) {
|
|
|
44
43
|
}}
|
|
45
44
|
>
|
|
46
45
|
<button
|
|
47
|
-
id={`nav-button-${
|
|
46
|
+
id={`nav-button-${baseId}`}
|
|
48
47
|
ref={buttonRef}
|
|
49
|
-
aria-controls={`nav-menu-${
|
|
48
|
+
aria-controls={`nav-menu-${baseId}`}
|
|
50
49
|
aria-expanded={open.value}
|
|
51
50
|
class="jumpu-text-button"
|
|
52
51
|
type="button"
|
|
@@ -55,8 +54,8 @@ function MenuList(props) {
|
|
|
55
54
|
{props.item.name}
|
|
56
55
|
</button>
|
|
57
56
|
<ul
|
|
58
|
-
id={`nav-menu-${
|
|
59
|
-
aria-labelledby={`nav-button-${
|
|
57
|
+
id={`nav-menu-${baseId}`}
|
|
58
|
+
aria-labelledby={`nav-button-${baseId}`}
|
|
60
59
|
class={twMerge(
|
|
61
60
|
"jumpu-card absolute top-full left-1/2 max-h-[50vh] -translate-x-1/2 overflow-y-auto p-2",
|
|
62
61
|
"translate-y-2 transition duration-75 ease-in-out",
|
|
@@ -76,16 +75,13 @@ function Desktop(props) {
|
|
|
76
75
|
return (
|
|
77
76
|
<nav class={props.class}>
|
|
78
77
|
<ul class="flex items-center">
|
|
79
|
-
{props.nav.map((item
|
|
78
|
+
{props.nav.map((item) =>
|
|
80
79
|
"children" in item ? (
|
|
81
|
-
<li key={
|
|
82
|
-
<MenuList item={item}
|
|
83
|
-
{item.children.map((child
|
|
84
|
-
<li key={
|
|
85
|
-
<a
|
|
86
|
-
class="jumpu-text-button w-full whitespace-nowrap"
|
|
87
|
-
href={child.path}
|
|
88
|
-
>
|
|
80
|
+
<li key={item.name} class="relative">
|
|
81
|
+
<MenuList item={item}>
|
|
82
|
+
{item.children.map((child) => (
|
|
83
|
+
<li key={child.name}>
|
|
84
|
+
<a class="jumpu-text-button w-full whitespace-nowrap" href={child.path}>
|
|
89
85
|
{child.name}
|
|
90
86
|
</a>
|
|
91
87
|
</li>
|
|
@@ -93,7 +89,7 @@ function Desktop(props) {
|
|
|
93
89
|
</MenuList>
|
|
94
90
|
</li>
|
|
95
91
|
) : (
|
|
96
|
-
<li key={
|
|
92
|
+
<li key={item.name}>
|
|
97
93
|
<a class="jumpu-text-button" href={item.path}>
|
|
98
94
|
{item.name}
|
|
99
95
|
</a>
|
|
@@ -1,8 +1,28 @@
|
|
|
1
|
-
import { clientComponent } from "@tuqulore-inc/eleventy-preset/island";
|
|
2
1
|
import { useSignal, useSignalEffect } from "@preact/signals";
|
|
3
|
-
import {
|
|
2
|
+
import { clientComponent } from "@tuqulore-inc/eleventy-preset/island";
|
|
3
|
+
import { useId, useRef } from "preact/hooks";
|
|
4
4
|
import { twMerge } from "tailwind-merge";
|
|
5
5
|
|
|
6
|
+
function NavGroup(props) {
|
|
7
|
+
const groupId = useId();
|
|
8
|
+
return (
|
|
9
|
+
<div class="mb-6">
|
|
10
|
+
<p id={groupId} class="mb-2 ml-4 text-lg">
|
|
11
|
+
{props.item.name}
|
|
12
|
+
</p>
|
|
13
|
+
<ul aria-labelledby={groupId}>
|
|
14
|
+
{props.item.children.map((child) => (
|
|
15
|
+
<li key={child.name}>
|
|
16
|
+
<a class="jumpu-text-button block" href={child.path}>
|
|
17
|
+
{child.name}
|
|
18
|
+
</a>
|
|
19
|
+
</li>
|
|
20
|
+
))}
|
|
21
|
+
</ul>
|
|
22
|
+
</div>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
6
26
|
function Mobile(props) {
|
|
7
27
|
const open = useSignal(false);
|
|
8
28
|
const openButtonRef = useRef(null);
|
|
@@ -31,9 +51,7 @@ function Mobile(props) {
|
|
|
31
51
|
ref={openButtonRef}
|
|
32
52
|
aria-controls="nav-menu-mobile"
|
|
33
53
|
aria-expanded={open.value}
|
|
34
|
-
aria-label={
|
|
35
|
-
open.value ? "Close navigation menu" : "Open navigation menu"
|
|
36
|
-
}
|
|
54
|
+
aria-label={open.value ? "Close navigation menu" : "Open navigation menu"}
|
|
37
55
|
class="jumpu-icon-button h-12 w-12 text-2xl"
|
|
38
56
|
type="button"
|
|
39
57
|
onClick={() => (open.value = !open.value)}
|
|
@@ -63,24 +81,9 @@ function Mobile(props) {
|
|
|
63
81
|
<span class="icon-[material-symbols--close]"></span>
|
|
64
82
|
</button>
|
|
65
83
|
<ul class="flex flex-col px-4 py-16">
|
|
66
|
-
{props.nav.map((item
|
|
67
|
-
<li key={
|
|
68
|
-
{item.children &&
|
|
69
|
-
<div class="mb-6" role="group" aria-label={item.name}>
|
|
70
|
-
<p class="mb-2 ml-4 text-lg" aria-hidden="true">
|
|
71
|
-
{item.name}
|
|
72
|
-
</p>
|
|
73
|
-
<ul>
|
|
74
|
-
{item.children.map((child, childIndex) => (
|
|
75
|
-
<li key={`${child.name}-${childIndex}`}>
|
|
76
|
-
<a class="jumpu-text-button block" href={child.path}>
|
|
77
|
-
{child.name}
|
|
78
|
-
</a>
|
|
79
|
-
</li>
|
|
80
|
-
))}
|
|
81
|
-
</ul>
|
|
82
|
-
</div>
|
|
83
|
-
)}
|
|
84
|
+
{props.nav.map((item) => (
|
|
85
|
+
<li key={item.name}>
|
|
86
|
+
{item.children && <NavGroup item={item} />}
|
|
84
87
|
{item.path && (
|
|
85
88
|
<a class="jumpu-text-button block" href={item.path}>
|
|
86
89
|
{item.name}
|
|
@@ -8,15 +8,10 @@ import Mobile from "./header/mobile.client.jsx";
|
|
|
8
8
|
<a class="flex-shrink-0" href="/">
|
|
9
9
|
{eleventy.site.name}
|
|
10
10
|
</a>
|
|
11
|
-
<Island
|
|
12
|
-
component={Desktop}
|
|
13
|
-
on="interaction"
|
|
14
|
-
class="hidden md:block"
|
|
15
|
-
nav={eleventy.nav}
|
|
16
|
-
/>
|
|
11
|
+
<Island component={Desktop} on="visible" class="hidden md:block" nav={eleventy.nav} />
|
|
17
12
|
<Island
|
|
18
13
|
component={Mobile}
|
|
19
|
-
on="
|
|
14
|
+
on="visible"
|
|
20
15
|
class="ml-auto flex items-center md:hidden"
|
|
21
16
|
nav={eleventy.nav}
|
|
22
17
|
/>
|
|
@@ -1,23 +1,11 @@
|
|
|
1
1
|
import { eleventy } from "@tuqulore-inc/eleventy-preset/eleventy";
|
|
2
2
|
|
|
3
|
-
<meta
|
|
4
|
-
|
|
5
|
-
content={eleventy.description ?? eleventy.site.description}
|
|
6
|
-
/>
|
|
7
|
-
<meta
|
|
8
|
-
property="og:description"
|
|
9
|
-
content={eleventy.description ?? eleventy.site.description}
|
|
10
|
-
/>
|
|
3
|
+
<meta name="description" content={eleventy.description ?? eleventy.site.description} />
|
|
4
|
+
<meta property="og:description" content={eleventy.description ?? eleventy.site.description} />
|
|
11
5
|
<meta property="og:site_name" content={eleventy.site.name} />
|
|
12
6
|
<meta property="og:title" content={eleventy.title} />
|
|
13
7
|
<meta property="og:type" content="website" />
|
|
14
|
-
<meta
|
|
15
|
-
|
|
16
|
-
content={new URL(eleventy.page.url, eleventy.site.url).href}
|
|
17
|
-
/>
|
|
18
|
-
<meta
|
|
19
|
-
property="og:image"
|
|
20
|
-
content={new URL(eleventy.ogp ?? "/ogp.png", eleventy.site.url).href}
|
|
21
|
-
/>
|
|
8
|
+
<meta property="og:url" content={new URL(eleventy.page.url, eleventy.site.url).href} />
|
|
9
|
+
<meta property="og:image" content={new URL(eleventy.ogp ?? "/ogp.png", eleventy.site.url).href} />
|
|
22
10
|
<meta property="og:image:alt" content={eleventy.title ?? eleventy.site.name} />
|
|
23
11
|
<meta name="twitter:card" content="summary" />
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
layout: base
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
layout: "base",
|
|
5
|
-
};
|
|
5
|
+
import { eleventy } from "@tuqulore-inc/eleventy-preset/eleventy";
|
|
6
6
|
|
|
7
7
|
<article class="prose" dangerouslySetInnerHTML={{ __html: eleventy.content }} />
|
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
import { clientComponent } from "@tuqulore-inc/eleventy-preset/island";
|
|
2
1
|
import { useSignal } from "@preact/signals";
|
|
2
|
+
import { clientComponent } from "@tuqulore-inc/eleventy-preset/island";
|
|
3
3
|
|
|
4
4
|
function Clicker() {
|
|
5
5
|
const counter = useSignal(0);
|
|
6
6
|
|
|
7
7
|
return (
|
|
8
8
|
<div class="flex items-center gap-4">
|
|
9
|
-
<button
|
|
10
|
-
type="button"
|
|
11
|
-
class="jumpu-button"
|
|
12
|
-
onClick={() => counter.value++}
|
|
13
|
-
>
|
|
9
|
+
<button type="button" class="jumpu-button" onClick={() => counter.value++}>
|
|
14
10
|
Count
|
|
15
11
|
</button>
|
|
16
12
|
<output class="text-xl tabular-nums">{counter}</output>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: post
|
|
3
|
+
title: ようこそ
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
import { Island } from "@tuqulore-inc/eleventy-preset/island";
|
|
2
7
|
import Clicker from "./clicker.client.jsx";
|
|
3
8
|
|
|
4
|
-
export const data = {
|
|
5
|
-
layout: "post",
|
|
6
|
-
title: "ようこそ",
|
|
7
|
-
};
|
|
8
|
-
|
|
9
9
|
# ようこそ
|
|
10
10
|
|
|
11
11
|
これは default テンプレートのスターターページです。`src/index.mdx` を編集して、実際のコンテンツに置き換えてください。
|
|
@@ -19,6 +19,6 @@ export const data = {
|
|
|
19
19
|
|
|
20
20
|
## Partial Hydration サンプル
|
|
21
21
|
|
|
22
|
-
以下のカウンターは Preact
|
|
22
|
+
以下のカウンターは Preact コンポーネントで、表示領域に入ったタイミングでクライアント側でハイドレーションされます。
|
|
23
23
|
|
|
24
|
-
<Island component={Clicker} on="
|
|
24
|
+
<Island component={Clicker} on="visible" />
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
pnpm-lock.yaml
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import js from "@eslint/js";
|
|
2
|
-
import prettier from "eslint-config-prettier/flat";
|
|
3
|
-
import * as mdx from "eslint-plugin-mdx";
|
|
4
|
-
import react from "eslint-plugin-react";
|
|
5
|
-
import { defineConfig, globalIgnores } from "eslint/config";
|
|
6
|
-
import globals from "globals";
|
|
7
|
-
|
|
8
|
-
export default defineConfig([
|
|
9
|
-
{
|
|
10
|
-
files: ["**/*.{cjs,js,jsx}"],
|
|
11
|
-
plugins: { js },
|
|
12
|
-
extends: ["js/recommended"],
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
files: ["**/*.cjs"],
|
|
16
|
-
languageOptions: { sourceType: "commonjs" },
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
files: ["**/*.{js,jsx}"],
|
|
20
|
-
languageOptions: { sourceType: "module" },
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
files: ["**/*.cjs", "*.js", "src/_data/**/*.js"],
|
|
24
|
-
languageOptions: { globals: globals.node },
|
|
25
|
-
},
|
|
26
|
-
{ ...react.configs.flat.recommended, files: ["**/*.{jsx,mdx}"] },
|
|
27
|
-
{
|
|
28
|
-
files: ["**/*.{jsx,mdx}"],
|
|
29
|
-
plugins: { react },
|
|
30
|
-
languageOptions: {
|
|
31
|
-
parserOptions: {
|
|
32
|
-
ecmaFeatures: { jsx: true },
|
|
33
|
-
},
|
|
34
|
-
globals: {
|
|
35
|
-
...globals.serviceworker,
|
|
36
|
-
...globals.browser,
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
settings: {
|
|
40
|
-
// NOTE: 本テンプレートは Preact 処理系だが、eslint-plugin-react の
|
|
41
|
-
// JSX 構文ルール (jsx-key など) を流用したい。version 未指定だと
|
|
42
|
-
// "React version not specified" 警告が出るので、Preact 10 の JSX
|
|
43
|
-
// runtime が API 互換な React 18 系をスタブとして与えて抑制する。
|
|
44
|
-
react: { version: "18.3.0" },
|
|
45
|
-
},
|
|
46
|
-
rules: {
|
|
47
|
-
"react/jsx-uses-react": "off",
|
|
48
|
-
"react/react-in-jsx-scope": "off",
|
|
49
|
-
"react/prop-types": "off",
|
|
50
|
-
"react/no-unknown-property": "off",
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
mdx.flat,
|
|
54
|
-
globalIgnores(["dist/"]),
|
|
55
|
-
prettier,
|
|
56
|
-
]);
|