Skip to content

Commit 3540f54

Browse files
authored
🔀 Merge #3: ✨ Add a search bar to docs
2 parents c42dc43 + 693a29f commit 3540f54

File tree

50 files changed

+5425
-2514
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+5425
-2514
lines changed

‎.github/workflows/publish.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,19 @@ jobs:
66
steps:
77
- uses: actions/checkout@v3
88

9-
- name: Set Node Version to 18
9+
- name: Set Node Version to 22
1010
uses: actions/setup-node@v2
1111
with:
12-
node-version: '18'
12+
node-version: '22'
13+
14+
- name: Enable Corepack
15+
run: corepack enable
1316

1417
- name: Install Dependencies
15-
uses: borales/actions-yarn@v4
16-
with:
17-
cmd: install
18+
run: yarn install
1819

19-
- name: Build Production Bundle
20-
uses: borales/actions-yarn@v4
21-
with:
22-
cmd: build
20+
- name: Build
21+
run: yarn build
2322

2423
- name: Push to Build Branch
2524
if: github.ref == 'refs/heads/main'
@@ -30,3 +29,6 @@ jobs:
3029
FOLDER: build # The directory where your assets are generated
3130
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GitHub will automatically add this - you don't need to bother getting a token
3231
MESSAGE: 'Build: ({sha}) {msg}' # The commit message
32+
# Env Secrets
33+
PUBLIC_ALGOLIA_ID: ${{ secrets.PUBLIC_ALGOLIA_ID }}
34+
PUBLIC_ALGOLIA_SEARCH_KEY: ${{ secrets.PUBLIC_ALGOLIA_SEARCH_KEY }}

‎.prettierrc

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,41 @@
11
{
2+
"$schema": "http://json.schemastore.org/prettierrc",
3+
"tabWidth": 4,
24
"useTabs": true,
5+
"semi": false,
36
"singleQuote": true,
4-
"trailingComma": "none",
7+
"arrowParens": "avoid",
58
"printWidth": 100,
6-
"plugins": ["prettier-plugin-svelte"],
7-
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }],
8-
"semi": false
9+
"trailingComma": "es5",
10+
"bracketSameLine": false,
11+
"endOfLine": "auto",
12+
"overrides": [
13+
{
14+
"files": ["**/*.yml", "**/*.yaml"],
15+
"options": {
16+
"parser": "yaml",
17+
"tabWidth": 2,
18+
"useTabs": false
19+
}
20+
},
21+
{
22+
"files": "**/*.ts",
23+
"options": {
24+
"parser": "typescript"
25+
}
26+
},
27+
{
28+
"files": "**/*.svelte",
29+
"options": {
30+
"parser": "svelte",
31+
"plugins": ["prettier-plugin-svelte"]
32+
}
33+
},
34+
{
35+
"files": "**/*.svg",
36+
"options": {
37+
"parser": "html"
38+
}
39+
}
40+
]
941
}

‎.yarn/install-state.gz

385 KB
Binary file not shown.

‎.yarnrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: node-modules

‎eslint.config.js

Lines changed: 0 additions & 33 deletions
This file was deleted.

‎eslint.config.ts

Lines changed: 266 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,266 @@
1+
import svelteEslint from 'eslint-plugin-svelte'
2+
import svelteParser from 'svelte-eslint-parser'
3+
import tsESLint, { type ConfigWithExtends } from 'typescript-eslint'
4+
import svelteConfig from './svelte.config'
5+
import type { NamingConventionRule } from './tslintNamingConventionRule'
6+
7+
console.log(`[${new Date().toLocaleTimeString()}] Loading ESLint config`)
8+
9+
const IGNORE_PATTERNS = [
10+
'.DS_Store',
11+
'.env',
12+
'.env.*',
13+
'.github',
14+
'.vscode',
15+
'**/node_modules/**',
16+
17+
// Blockbench Plugin Template
18+
'dist/**/*',
19+
20+
// Ignore files for PNPM, NPM and YARN
21+
'pnpm-lock.yaml',
22+
'package-lock.json',
23+
'yarn.lock'
24+
]
25+
26+
const CUSTOM_RULES: ConfigWithExtends['rules'] = {
27+
// ESLint
28+
semi: ['error', 'never'],
29+
'prefer-const': 'warn',
30+
'no-fallthrough': 'off',
31+
'no-mixed-spaces-and-tabs': 'off',
32+
'no-unreachable': 'warn',
33+
'@typescript-eslint/no-unused-vars': [
34+
'warn',
35+
{
36+
vars: 'local',
37+
args: 'after-used',
38+
argsIgnorePattern: '^_',
39+
ignoreRestSiblings: true
40+
}
41+
],
42+
// Svelte
43+
'svelte/html-quotes': ['warn', { prefer: 'double' }],
44+
'svelte/block-lang': ['error', { script: ['ts', null], style: null }],
45+
'svelte/comment-directive': ['error', { reportUnusedDisableDirectives: true }],
46+
// Check File
47+
'check-file/filename-naming-convention': [
48+
'error',
49+
{
50+
'src/**/*.{ts.d.ts}': 'CAMEL_CASE',
51+
'tools/**/*.{ts.d.ts}': 'CAMEL_CASE'
52+
}
53+
],
54+
'check-file/folder-naming-convention': [
55+
'error',
56+
{
57+
'src/**': 'KEBAB_CASE',
58+
'tools/**': 'KEBAB_CASE'
59+
}
60+
],
61+
// TypeScript
62+
'@typescript-eslint/no-explicit-any': 'off',
63+
'@typescript-eslint/no-floating-promises': ['error', { ignoreVoid: true }],
64+
'@typescript-eslint/array-type': ['warn', { default: 'array-simple' }],
65+
'@typescript-eslint/consistent-indexed-object-style': ['warn', 'record'],
66+
'@typescript-eslint/consistent-generic-constructors': 'warn',
67+
'@typescript-eslint/no-namespace': 'off',
68+
'@typescript-eslint/restrict-template-expressions': 'off',
69+
'@typescript-eslint/no-unsafe-member-access': 'off',
70+
'@typescript-eslint/no-unsafe-assignment': 'off',
71+
'@typescript-eslint/ban-ts-comment': 'off',
72+
'@typescript-eslint/require-await': 'warn',
73+
'@typescript-eslint/no-unsafe-call': 'off',
74+
'@typescript-eslint/unbound-method': 'off',
75+
'@typescript-eslint/no-non-null-assertion': 'off',
76+
'@typescript-eslint/triple-slash-reference': 'off',
77+
// Naming conventions
78+
'@typescript-eslint/naming-convention': [
79+
'warn',
80+
{
81+
// DFU Version imports
82+
selector: ['import'],
83+
modifiers: ['default'],
84+
filter: {
85+
regex: 'v\\d+_\\d+_\\d+$',
86+
match: true
87+
},
88+
custom: {
89+
match: true,
90+
regex: 'v\\d+_\\d+_\\d+$'
91+
},
92+
format: null
93+
},
94+
{
95+
selector: ['import'],
96+
modifiers: ['default'],
97+
format: ['camelCase', 'PascalCase', 'UPPER_CASE']
98+
},
99+
{
100+
selector: 'class',
101+
format: ['PascalCase']
102+
},
103+
{
104+
selector: ['classProperty', 'classMethod'],
105+
format: ['camelCase']
106+
},
107+
{
108+
selector: ['classProperty', 'classMethod'],
109+
leadingUnderscore: 'allow',
110+
format: ['camelCase']
111+
},
112+
{
113+
selector: ['classProperty', 'classMethod'],
114+
modifiers: ['private'],
115+
leadingUnderscore: 'allowDouble',
116+
trailingUnderscore: 'allowDouble',
117+
format: ['camelCase']
118+
},
119+
{
120+
selector: 'typeProperty',
121+
format: null
122+
},
123+
{
124+
selector: 'variable',
125+
modifiers: ['const', 'destructured'],
126+
format: null
127+
},
128+
{
129+
selector: 'variable',
130+
modifiers: ['const', 'global'],
131+
types: ['function'],
132+
leadingUnderscore: 'allow',
133+
format: ['UPPER_CASE', 'camelCase']
134+
},
135+
{
136+
selector: 'variable',
137+
modifiers: ['const', 'global'],
138+
leadingUnderscore: 'allow',
139+
format: ['UPPER_CASE']
140+
},
141+
{
142+
selector: 'variable',
143+
modifiers: ['const', 'exported'],
144+
format: ['camelCase', 'UPPER_CASE']
145+
},
146+
{
147+
selector: 'variableLike',
148+
format: ['camelCase']
149+
},
150+
{ selector: 'interface', format: ['PascalCase'] },
151+
{
152+
selector: 'interface',
153+
modifiers: ['exported'],
154+
format: ['PascalCase'],
155+
prefix: ['I']
156+
},
157+
{ selector: 'typeLike', format: ['PascalCase'] },
158+
{ selector: 'objectLiteralProperty', format: null },
159+
{ selector: 'default', format: ['camelCase'] },
160+
{
161+
selector: 'parameter',
162+
modifiers: ['unused'],
163+
format: ['camelCase'],
164+
leadingUnderscore: 'allow'
165+
},
166+
{
167+
selector: 'parameter',
168+
format: ['camelCase']
169+
},
170+
{
171+
selector: 'enumMember',
172+
format: ['camelCase', 'PascalCase', 'UPPER_CASE']
173+
},
174+
{
175+
selector: 'enum',
176+
format: ['UPPER_CASE']
177+
}
178+
] satisfies NamingConventionRule
179+
}
180+
181+
export default tsESLint.config(
182+
{
183+
ignores: IGNORE_PATTERNS
184+
},
185+
...tsESLint.configs.stylisticTypeChecked,
186+
...svelteEslint.configs['flat/prettier'],
187+
{
188+
plugins: {
189+
'@typescript-eslint': tsESLint.plugin,
190+
svelte: svelteEslint
191+
}
192+
},
193+
{
194+
rules: CUSTOM_RULES
195+
},
196+
{
197+
languageOptions: {
198+
parser: tsESLint.parser,
199+
parserOptions: {
200+
project: './tsconfig.json',
201+
extraFileExtensions: ['.svelte']
202+
},
203+
globals: {
204+
browser: true,
205+
node: true
206+
}
207+
}
208+
},
209+
{
210+
files: ['**/*.svelte'],
211+
rules: {
212+
// Causes issues with Svelte and global types
213+
'no-undef': 'off',
214+
'@typescript-eslint/naming-convention': [
215+
'warn',
216+
{
217+
selector: 'variable',
218+
modifiers: ['exported'],
219+
format: ['camelCase']
220+
},
221+
{
222+
selector: 'variable',
223+
modifiers: ['const', 'global'],
224+
format: ['UPPER_CASE']
225+
},
226+
{
227+
selector: 'variable',
228+
modifiers: ['const', 'global'],
229+
types: ['function'],
230+
format: ['camelCase']
231+
},
232+
{
233+
selector: 'variable',
234+
format: ['camelCase'],
235+
leadingUnderscore: 'allow'
236+
}
237+
] satisfies NamingConventionRule
238+
},
239+
languageOptions: {
240+
parser: svelteParser,
241+
parserOptions: {
242+
parser: tsESLint.parser,
243+
svelteConfig: svelteConfig,
244+
extraFileExtensions: ['.svelte']
245+
},
246+
globals: {
247+
browser: true,
248+
node: true
249+
}
250+
},
251+
settings: {
252+
ignoreWarnings: ['svelte/a11y-no-onchange', 'a11y-no-onchange']
253+
}
254+
},
255+
{
256+
languageOptions: {
257+
parserOptions: {
258+
projectService: true,
259+
tsconfigRootDir: '.'
260+
}
261+
},
262+
linterOptions: {
263+
reportUnusedDisableDirectives: true
264+
}
265+
}
266+
)

0 commit comments

Comments
 (0)