Skip to content

Commit 900e72c

Browse files
Initial release
0 parents  commit 900e72c

23 files changed

Lines changed: 4962 additions & 0 deletions

.codesandbox/tasks.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
// These tasks will run in order when initializing your CodeSandbox project.
3+
"setupTasks": [
4+
{
5+
"name": "Install Dependencies",
6+
"command": "pnpm install"
7+
}
8+
],
9+
10+
// These tasks can be run from CodeSandbox. Running one will open a log in the app.
11+
"tasks": {
12+
"dev": {
13+
"name": "dev",
14+
"command": "pnpm dev",
15+
"runAtStart": true
16+
},
17+
"build": {
18+
"name": "build",
19+
"command": "pnpm build",
20+
"runAtStart": false
21+
},
22+
"lint": {
23+
"name": "lint",
24+
"command": "pnpm lint",
25+
"runAtStart": false
26+
},
27+
"preview": {
28+
"name": "preview",
29+
"command": "pnpm preview",
30+
"runAtStart": false
31+
}
32+
}
33+
}

.devcontainer/devcontainer.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node
3+
{
4+
"name": "Node.js & TypeScript",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-20-bullseye"
7+
8+
// Features to add to the dev container. More info: https://containers.dev/features.
9+
// "features": {},
10+
11+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
12+
// "forwardPorts": [],
13+
14+
// Use 'postCreateCommand' to run commands after the container is created.
15+
// "postCreateCommand": "yarn install",
16+
17+
// Configure tool-specific properties.
18+
// "customizations": {},
19+
20+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
21+
// "remoteUser": "root"
22+
}

.eslintrc.js

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
/** @type {import("eslint").Linter.Config} */
2+
module.exports = {
3+
env: {
4+
node: true,
5+
},
6+
extends: [
7+
"eslint:recommended",
8+
"plugin:@typescript-eslint/recommended",
9+
"plugin:react/recommended",
10+
"plugin:react-hooks/recommended",
11+
"prettier",
12+
],
13+
globals: {
14+
JSX: true,
15+
React: true,
16+
},
17+
ignorePatterns: [
18+
// Ignore dotfiles
19+
".*.js",
20+
"node_modules/",
21+
"dist/",
22+
],
23+
overrides: [
24+
{
25+
files: ["*.js?(x)", "*.ts?(x)"],
26+
},
27+
],
28+
plugins: [
29+
"import",
30+
"only-warn",
31+
"sort-destructure-keys",
32+
"sort-keys-plus",
33+
"typescript-sort-keys",
34+
"unused-imports",
35+
],
36+
rules: {
37+
"@typescript-eslint/explicit-module-boundary-types": "off",
38+
"@typescript-eslint/no-unused-vars": [
39+
"error",
40+
{
41+
argsIgnorePattern: "^_",
42+
caughtErrorsIgnorePattern: "^_",
43+
ignoreRestSiblings: true,
44+
varsIgnorePattern: "^_",
45+
},
46+
],
47+
curly: "error",
48+
"import/no-cycle": ["warn"],
49+
"import/order": [
50+
"warn",
51+
{
52+
alphabetize: {
53+
caseInsensitive: false,
54+
order: "asc",
55+
},
56+
groups: [
57+
"builtin",
58+
"external",
59+
"type",
60+
"internal",
61+
"parent",
62+
"sibling",
63+
"index",
64+
],
65+
"newlines-between": "never",
66+
pathGroups: [
67+
{
68+
group: "external",
69+
pattern: "react",
70+
position: "before",
71+
},
72+
{
73+
group: "internal",
74+
pattern: "@modernfi/**",
75+
position: "before",
76+
},
77+
{
78+
group: "internal",
79+
pattern: "flagship/**",
80+
position: "before",
81+
},
82+
],
83+
pathGroupsExcludedImportTypes: ["react"],
84+
warnOnUnassignedImports: true,
85+
},
86+
],
87+
"no-case-declarations": "off",
88+
"no-empty-pattern": "off",
89+
"no-multiple-empty-lines": ["error", { max: 1, maxBOF: 0, maxEOF: 1 }],
90+
"no-unused-vars": "off",
91+
"react/jsx-newline": ["warn", { prevent: true }],
92+
"react/jsx-sort-props": [
93+
"warn",
94+
{
95+
callbacksLast: false,
96+
ignoreCase: false,
97+
locale: "auto",
98+
multiline: "ignore",
99+
noSortAlphabetically: false,
100+
reservedFirst: false,
101+
shorthandFirst: false,
102+
shorthandLast: false,
103+
},
104+
],
105+
"react/jsx-uses-react": "off",
106+
"react/react-in-jsx-scope": "off",
107+
"react/self-closing-comp": "error",
108+
"react-hooks/exhaustive-deps": "error",
109+
"require-await": "error",
110+
"sort-destructure-keys/sort-destructure-keys": [
111+
"warn",
112+
{ caseSensitive: true },
113+
],
114+
"sort-imports": [
115+
"warn",
116+
{
117+
// let import/order deal with declarations
118+
ignoreDeclarationSort: true,
119+
},
120+
],
121+
"sort-keys-plus/sort-keys": [
122+
"warn",
123+
"asc",
124+
{
125+
allowLineSeparatedGroups: true,
126+
natural: true,
127+
},
128+
],
129+
"typescript-sort-keys/interface": [
130+
"warn",
131+
"asc",
132+
{
133+
caseSensitive: true,
134+
natural: true,
135+
requiredFirst: false,
136+
},
137+
],
138+
"typescript-sort-keys/string-enum": [
139+
"warn",
140+
"asc",
141+
{
142+
caseSensitive: true,
143+
natural: true,
144+
},
145+
],
146+
"unused-imports/no-unused-imports": "warn",
147+
},
148+
settings: {
149+
react: {
150+
version: "detect",
151+
},
152+
},
153+
};

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for more information:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
# https://containers.dev/guide/dependabot
6+
7+
version: 2
8+
updates:
9+
- package-ecosystem: "devcontainers"
10+
directory: "/"
11+
schedule:
12+
interval: weekly

.gitignore

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
2+
# dependencies
3+
node_modules
4+
.pnp
5+
.pnp.js
6+
7+
# testing
8+
coverage
9+
10+
# next.js
11+
.next/
12+
out/
13+
build
14+
15+
# misc
16+
.DS_Store
17+
*.pem
18+
.idea/
19+
20+
# debug
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*
24+
.pnpm-debug.log*
25+
26+
# local env files
27+
.env.local
28+
.env.development.local
29+
.env.test.local
30+
.env.production.local
31+
32+
# turbo
33+
.turbo
34+
35+
bundle-stats/
36+
37+
#-------------------------------------------------------------------------------------------------------------------
38+
# Prettier-specific overrides
39+
#-------------------------------------------------------------------------------------------------------------------
40+
41+
# Package manager files
42+
yarn.lock
43+
package-lock.json
44+
shrinkwrap.json
45+
46+
# Build outputs
47+
dist
48+
lib
49+
50+
# vscode templates
51+
.vscode
52+
53+
# docker ignore
54+
.dockerignore

.prettierignore

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#-------------------------------------------------------------------------------------------------------------------
2+
# Keep this section in sync with .gitignore (periodically copy+paste)
3+
#-------------------------------------------------------------------------------------------------------------------
4+
5+
# dependencies
6+
node_modules
7+
.pnp
8+
.pnp.js
9+
10+
# testing
11+
coverage
12+
13+
# next.js
14+
.next/
15+
out/
16+
build
17+
18+
# misc
19+
.DS_Store
20+
*.pem
21+
.idea/
22+
23+
# debug
24+
npm-debug.log*
25+
yarn-debug.log*
26+
yarn-error.log*
27+
.pnpm-debug.log*
28+
29+
# local env files
30+
.env.local
31+
.env.development.local
32+
.env.test.local
33+
.env.production.local
34+
35+
# turbo
36+
.turbo
37+
38+
bundle-stats/
39+
40+
#-------------------------------------------------------------------------------------------------------------------
41+
# Prettier-specific overrides
42+
#-------------------------------------------------------------------------------------------------------------------
43+
44+
# Package manager files
45+
pnpm-lock.yaml
46+
yarn.lock
47+
package-lock.json
48+
shrinkwrap.json
49+
50+
# Build outputs
51+
dist
52+
lib
53+
54+
# Prettier reformats code blocks inside Markdown, which affects rendered output
55+
*.md
56+
57+
# vscode templates
58+
.vscode
59+
60+
# docker ignore
61+
.dockerignore

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Ryan Howard
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Infinite Scroll Example App
2+
3+
This is the app covered in the Infinite Scroll blog post.
4+
5+
## Quickstart
6+
7+
1. Install: `npm install`
8+
2. Run in local dev mode: `npm run dev`

index.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>Infinite Scroll Example | @spa-tools</title>
7+
<meta name="title" content="Infinite Scroll Example" />
8+
<meta
9+
name="description"
10+
content="A simple example that shows how to implement infinite scrolling with a little help from @spa-tools."
11+
/>
12+
</head>
13+
<body>
14+
<div id="root"></div>
15+
<script type="module" src="/src/root.tsx"></script>
16+
</body>
17+
</html>

0 commit comments

Comments
 (0)