Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to pass any options? #44

Open
landwire opened this issue Oct 8, 2020 · 3 comments
Open

Is it possible to pass any options? #44

landwire opened this issue Oct 8, 2020 · 3 comments

Comments

@landwire
Copy link

landwire commented Oct 8, 2020

On "A fitting image source should be available for all screen sizes" I would like images to be allowed to differ for up to 15%.
Is that possible?

@landwire
Copy link
Author

landwire commented Oct 8, 2020

I can see the options in the script.
const threshold = 0.05;
const thresholdPx = 15;

If I cannot adjust those, could I create my own instance of the bookmarklet?
How would I do this?

@landwire
Copy link
Author

landwire commented Oct 8, 2020

Other Question:
Would it also be possible to compare the images based on image size rather than on width?
Then you could use a threshold of lets say 50kb or maybe an array of thresholds depending on the viewports?
So maybe on small screens the threshold wants to be 15kb, but on bigger screens you want to go up to 50kb.

@ausi
Copy link
Owner

ausi commented Oct 8, 2020

Is it possible to pass any options?

No, currently it is not possible to configure any options of the linter.

On "A fitting image source should be available for all screen sizes" I would like images to be allowed to differ for up to 15%.
Is that possible?

The threshold for that check (missingFittingSrc) is set to 50%, see

If I cannot adjust those, could I create my own instance of the bookmarklet?
How would I do this?

This project uses gulp.js to build the source code. Running npm install and ./node_modules/.bin/gulp should build the bookmarklet inside the dist folder.

Would it also be possible to compare the images based on image size rather than on width?

I’m not sure if we have access to the file sizes of the images. But if this project one day gets rewritten as a dev-tools extension (see #10 (comment) ) this should definitely be possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants