Skip to content

Commit c60bb33

Browse files
committed
update dependencies
1 parent 12b6ad2 commit c60bb33

File tree

11 files changed

+2330
-3810
lines changed

11 files changed

+2330
-3810
lines changed

.eslintrc.cjs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,17 @@ module.exports = {
22
root: true,
33
parser: '@typescript-eslint/parser',
44
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'],
5-
plugins: ['svelte3', '@typescript-eslint'],
5+
plugins: ['@typescript-eslint'],
66
ignorePatterns: ['*.cjs'],
7-
overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }],
8-
settings: {
9-
'svelte3/typescript': () => require('typescript')
10-
},
7+
overrides: [
8+
{
9+
files: ['*.svelte'],
10+
parser: 'svelte-eslint-parser',
11+
parserOptions: {
12+
parser: '@typescript-eslint/parser'
13+
}
14+
}
15+
],
1116
parserOptions: {
1217
sourceType: 'module',
1318
ecmaVersion: 2019

README.md

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@ A Svelte component which uses CDNs to serve responsive images.
55
## Usage
66

77
### Install
8+
89
`npm i @joeinnes/svelte-image`
910

1011
### Import
12+
1113
Note that except for the 'alt' tag, all tags are optional and their default values are shown in the example below.
14+
1215
```
1316
<script>
1417
import { Image } from '@joeinnes/svelte-image';
@@ -28,16 +31,18 @@ provider.set({
2831
```
2932

3033
Currently supported:
31-
* Statically (zero configuration)
32-
* Cloudimage (use your token as the 'key')
34+
35+
- Statically (zero configuration)
36+
- Cloudimage (use your token as the 'key')
3337

3438
```
3539
provider.set({
3640
name: 'cloudimage',
3741
key: 'cloudimage_token'
3842
})
3943
```
40-
* Cloudinary (you need to create an HTTP Proxy media source, and then use your cloud name as the key)
44+
45+
- Cloudinary (you need to create an HTTP Proxy media source, and then use your cloud name as the key)
4146

4247
```
4348
provider.set({
@@ -48,13 +53,14 @@ provider.set({
4853

4954
## Notes and Caveats
5055

51-
* hidpi mode will load the image double size for retina displays.
56+
- hidpi mode will load the image double size for retina displays.
5257

53-
* You should provide a full URL to the image, not a relative path.
58+
- You should provide a full URL to the image, not a relative path.
5459

55-
* In case you're using Statically (ie: the default) and there's no supported extension (gif, jpg, jpeg, png, or webp) listed in the image path, then the component will render the original, unoptimised version (https://twitter.com/staticallyio/status/1405700757475663873). You may be able to work around this by adding an ignored query (eg: `&image.jpg`) to the end of the URL or somewhere in the path, but results may vary. For example, https://pbs.twimg.com/media/FEBzSvdWYAoVJGc?format=jpg&name=medium does not contain '.jpg', and appending `&image.jpg` does not work. However, you can add the .jpg after the ID: `https://pbs.twimg.com/media/FEBzSvdWYAoVJGc.jpg?format=jpg&name=medium`. This will vary depending on the origin.
60+
- In case you're using Statically (ie: the default) and there's no supported extension (gif, jpg, jpeg, png, or webp) listed in the image path, then the component will render the original, unoptimised version (https://twitter.com/staticallyio/status/1405700757475663873). You may be able to work around this by adding an ignored query (eg: `&image.jpg`) to the end of the URL or somewhere in the path, but results may vary. For example, https://pbs.twimg.com/media/FEBzSvdWYAoVJGc?format=jpg&name=medium does not contain '.jpg', and appending `&image.jpg` does not work. However, you can add the .jpg after the ID: `https://pbs.twimg.com/media/FEBzSvdWYAoVJGc.jpg?format=jpg&name=medium`. This will vary depending on the origin.
5661

5762
## Aspect Ratio
63+
5864
Don't know exactly what aspect ratio your container will have when it loads on a user's screen? Use `bind:clientWidth` and `bind:clientHeight` to calculate the aspect ratio:
5965

6066
```
@@ -71,20 +77,20 @@ Don't know exactly what aspect ratio your container will have when it loads on a
7177

7278
## Have full control of your server?
7379

74-
Then this might not be the best package for you.
80+
Then this might not be the best package for you.
7581

7682
This component is more suitable if you:
7783

78-
* don't have a server
79-
* don't have storage space/processing power on the server
80-
* need images to be cropped/resized/whatever at runtime rather than at buildtime
81-
* want something that works with SvelteKit
82-
* don't have a CDN in place already
84+
- don't have a server
85+
- don't have storage space/processing power on the server
86+
- need images to be cropped/resized/whatever at runtime rather than at buildtime
87+
- want something that works with SvelteKit
88+
- don't have a CDN in place already
8389

8490
If you:
8591

86-
* have a CDN in place
87-
* need more finegrained control over image processing
88-
* don't want third parties interfering with your images
92+
- have a CDN in place
93+
- need more finegrained control over image processing
94+
- don't want third parties interfering with your images
8995

9096
You might instead want to check out https://github.com/matyunya/svelte-image

0 commit comments

Comments
 (0)