Skip to content

Commit 9867103

Browse files
authored
chore: switch indentation to spaces in README.md (#316)
* chore: switch indentation to spaces in README.md * chore: also indent space for docs/**/*.md
1 parent 4fc9003 commit 9867103

File tree

6 files changed

+73
-72
lines changed

6 files changed

+73
-72
lines changed

.editorconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ indent_size = 2
88
charset = utf-8
99
trim_trailing_whitespace = true
1010

11-
[package.json]
11+
[{package.json, README.md, docs/**/*.md}]
1212
indent_style = space
13+

.prettierrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module.exports = {
2020
}
2121
},
2222
{
23-
files: '**/package.json',
23+
files: ['**/package.json', '**/README.md', 'docs/**/*.md'],
2424
options: {
2525
useTabs: false,
2626
tabWidth: 2

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ import { defineConfig } from 'vite';
2020
import { svelte } from '@sveltejs/vite-plugin-svelte';
2121

2222
export default defineConfig({
23-
plugins: [
24-
svelte({
25-
/* plugin options */
26-
})
27-
]
23+
plugins: [
24+
svelte({
25+
/* plugin options */
26+
})
27+
]
2828
});
2929
```
3030

docs/config.md

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
```js
66
export default defineConfig({
7-
plugins: [
8-
svelte({
9-
/* plugin options */
10-
})
11-
]
7+
plugins: [
8+
svelte({
9+
/* plugin options */
10+
})
11+
]
1212
});
1313
```
1414

@@ -28,11 +28,11 @@ To set a specific config file, use the `configFile` inline option. The path can
2828

2929
```js
3030
export default defineConfig({
31-
plugins: [
32-
svelte({
33-
configFile: 'my-svelte.config.js'
34-
})
35-
]
31+
plugins: [
32+
svelte({
33+
configFile: 'my-svelte.config.js'
34+
})
35+
]
3636
});
3737
```
3838

@@ -41,7 +41,7 @@ A basic Svelte config looks like this:
4141
```js
4242
// svelte.config.js
4343
export default {
44-
// config options
44+
// config options
4545
};
4646
```
4747

@@ -78,11 +78,11 @@ These options are specific to the Svelte compiler and are generally shared acros
7878
import sveltePreprocess from 'svelte-preprocess';
7979

8080
export default defineConfig({
81-
plugins: [
82-
svelte({
83-
preprocess: [sveltePreprocess({ typescript: true })]
84-
})
85-
]
81+
plugins: [
82+
svelte({
83+
preprocess: [sveltePreprocess({ typescript: true })]
84+
})
85+
]
8686
});
8787
```
8888

@@ -126,17 +126,17 @@ A [picomatch pattern](https://github.com/micromatch/picomatch), or array of patt
126126

127127
```js
128128
export default defineConfig({
129-
plugins: [
130-
svelte({
131-
onwarn(warning, defaultHandler) {
132-
// don't warn on <marquee> elements, cos they're cool
133-
if (warning.code === 'a11y-distracting-elements') return;
134-
135-
// handle all other warnings normally
136-
defaultHandler(warning);
137-
}
138-
})
139-
]
129+
plugins: [
130+
svelte({
131+
onwarn(warning, defaultHandler) {
132+
// don't warn on <marquee> elements, cos they're cool
133+
if (warning.code === 'a11y-distracting-elements') return;
134+
135+
// handle all other warnings normally
136+
defaultHandler(warning);
137+
}
138+
})
139+
]
140140
});
141141
```
142142

@@ -176,13 +176,13 @@ These options are considered experimental and breaking changes to them can occur
176176

177177
```js
178178
export default defineConfig({
179-
plugins: [
180-
svelte({
181-
experimental: {
182-
// experimental options
183-
}
184-
})
185-
]
179+
plugins: [
180+
svelte({
181+
experimental: {
182+
// experimental options
183+
}
184+
})
185+
]
186186
});
187187
```
188188

@@ -213,9 +213,9 @@ export default defineConfig({
213213

214214
```ts
215215
type DynamicCompileOptions = (data: {
216-
filename: string; // The file to be compiled
217-
code: string; // The preprocessed Svelte code
218-
compileOptions: Partial<CompileOptions>; // The current compiler options
216+
filename: string; // The file to be compiled
217+
code: string; // The preprocessed Svelte code
218+
compileOptions: Partial<CompileOptions>; // The current compiler options
219219
}) => Promise<Partial<CompileOptions> | void> | Partial<CompileOptions> | void;
220220
```
221221

@@ -225,17 +225,17 @@ export default defineConfig({
225225

226226
```js
227227
export default defineConfig({
228-
plugins: [
229-
svelte({
230-
experimental: {
231-
dynamicCompileOptions({ filename, compileOptions }) {
232-
// Dynamically set hydration per Svelte file
233-
if (compileWithHydratable(filename) && !compileOptions.hydratable) {
234-
return { hydratable: true };
235-
}
236-
}
237-
}
238-
})
239-
]
228+
plugins: [
229+
svelte({
230+
experimental: {
231+
dynamicCompileOptions({ filename, compileOptions }) {
232+
// Dynamically set hydration per Svelte file
233+
if (compileWithHydratable(filename) && !compileOptions.hydratable) {
234+
return { hydratable: true };
235+
}
236+
}
237+
}
238+
})
239+
]
240240
});
241241
```

docs/faq.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Good:
5454
```scss
5555
/* global.scss */
5656
html {
57-
color: $text-color;
57+
color: $text-color;
5858
}
5959
```
6060

@@ -67,9 +67,9 @@ Bad:
6767

6868
```svelte
6969
<style lang="scss">
70-
:global(html) {
71-
color: $text-color;
72-
}
70+
:global(html) {
71+
color: $text-color;
72+
}
7373
</style>
7474
```
7575

@@ -79,13 +79,13 @@ If you are building a Vite plugin that transforms CSS or JS, you can add a `api.
7979

8080
```js
8181
const vitePluginCoolCss = {
82-
name: 'vite-plugin-coolcss',
83-
api: {
84-
sveltePreprocess: {
85-
/* your PreprocessorGroup here */
86-
}
87-
}
88-
/*... your cool css plugin implementation here .. */
82+
name: 'vite-plugin-coolcss',
83+
api: {
84+
sveltePreprocess: {
85+
/* your PreprocessorGroup here */
86+
}
87+
}
88+
/*... your cool css plugin implementation here .. */
8989
};
9090
```
9191

packages/vite-plugin-svelte/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ import { defineConfig } from 'vite';
1010
import { svelte } from '@sveltejs/vite-plugin-svelte';
1111

1212
export default defineConfig({
13-
plugins: [
14-
svelte({
15-
/* plugin options */
16-
})
17-
]
13+
plugins: [
14+
svelte({
15+
/* plugin options */
16+
})
17+
]
1818
});
1919
```
2020

0 commit comments

Comments
 (0)