Comments (4)
Have done a first pass on this, some notes: npm run lint
only shows the filename of something wrong, you need to do npm run format
and then use the diff view to see what got changed. And yes it is a lot of minor things like single/double quotes, extra commas, etc. It passes the npm run tests
though which is good.
BUT - some of the more deliberate formatting in components, especially around large case statements for applying class strings, get stretched out vertically. Also, it strips commented urls in <-- --> for some reason and I can see that they are handy reference urls that should not be removed.
Ultimately, it has to be script based, because it will be going to CI/CD at some point and there is no maintainer sanity to be had on vetting each commit for linting on top of things like code quality/functionality. I'm happy to see if there is some more tweaking that can be done on the rules, but I dare say the defaults are pretty sane from the svelte linting settings that seem to be there.
I can convert the <-- url -->
to \\ commented urls
so that they will be preserved on future runs, but I think the carefully crafted case statements are going to be a victim here (or lots of // prettier-ignore's)
from skeleton.
Ok, sounds like the current config is not working as expected. We definitely don't want to strip out URL comments as those typically contain useful references or documentation. In that case, leave this one to me. I'll look to adjust the the config and then we'll go from there. Thanks for taking a look though!
Again, I'd advise we not proceed on this until the a11y updates are in complete as these include a notable amount of code changes and refactoring. We might duplicate effort otherwise.
from skeleton.
Using the following as .prettierrc
{
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 140,
"htmlWhitespaceSensitivity": "ignore",
"svelteSortOrder": "options-styles-scripts-markup",
"svelteStrictMode": false,
"svelteBracketNewLine": false,
"svelteAllowShorthand": true,
"svelteIndentScriptAndStyle": true
}
Comments aren't being stripped, but they are being moved to below the main <script>
tag (well most of them anyways), this is most noticeable on ConicGradient. And it likes <script lang='postcss'>
at the top too.
Adjusting the printWidth to 140 stopped a few line wraps on let class = 'long class string'
- but I can't confirm on a laptop right now if that makes side scrolling a thing. Not really a big deal either way.
It's really only, Button, Avatar, Menu, Toast, Tooltip and some of the source props for tables in data-tables, drawers, lists, menus, paginators that could do with a judicial // prettier-ignore
to preserve some chunks. Much less than I thought.
It has made the docs pages source a lot easier for spell checking due to the column wrap. Have done a visual check on the served docs pages and no rendering issues on that side either.
Definitely will wait till A11y stuff is done, but this is looking nice and straight forward now.
from skeleton.
This is great! These changes will be far reaching so I'd like give this a once-over as well before we implement, but I'll definitely use your config as the baseline.
I'd be surprised if there's no a way to keep comments at the top of the file. Perhaps they need to be formatted multi-line?
/*
* Example Comment
*/
Line wrapping does help readability in most cases. We'll aim to modify the code and accommodate and meet the requirements we settle on (140, etc), then opt for the prettier-ignore as sparingly as possible.
Excited to check it out though!
from skeleton.
Related Issues (20)
- Add special comment to Tailwind config to enable HRM reloading on plugin changes
- Improve intermediate page navigation UI
- favicon.png HOT 2
- Modals prerequisites should also import Modal
- error in docs
- Progress Bars: discrepancy in usage code
- Codeblocks with shiki highlighter HOT 3
- Modal rendering inconsistent. Disappearing Modals. HOT 1
- NEXT Iconography Docs
- Feature request: Support popular routers like svelte-spa-router and routify HOT 6
- NEXT React Form Handling HOT 1
- NEXT Date Picker and Date Handling HOT 1
- Installing with bun hits exception HOT 2
- Add accessibility attributes to Autocomplete HOT 1
- [Skeleton v2] - Light scrollbar is displayed instead of dark one on Opera browser HOT 4
- Autocomplete page: Add blurb about importing popup in popup section
- AppRailTile and AppRailAnchor default styling
- progressbar.css in build HOT 1
- v3 dep bump
- Possibilty to disable focus of Ratings component inner buttons HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from skeleton.