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

feat: adds stylelint order to the config and demo file #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ryanhagerty
Copy link

@ryanhagerty ryanhagerty commented Aug 5, 2022

This is really two commits as additional work was required to be able to commit.

Summary

  1. Adds the stylelint-order package and defines our ordering in styleling.config.js
  2. Fixes issues with both updated eslint and prettier packages.
    a. eslint now requires a .eslintrc.js file, so this was added to extend the existing index.js config file.
    b. prettier will error out if it cannot find files to lint, so I added the recently introduced --no-error-on-unmatched-pattern flag to the commands.
    c. general linting fixes

Testing

  1. Pull down this branch and install the new package.
  2. Rename example.property-order.scss.demo to property-order.scss.
  3. Run npm run lint and see how we now have warnings when our scss is ordered incorrectly (screenshot below).
  4. Throw a party for your family and friends to celebrate scss property ordering. Maybe even rent a bouncy house.

Screenshots

Screen Shot 2022-08-05 at 10 14 31 AM

this also adds fixes for both eslint and prettier to enable
committing. updates to both packages broke the committing process.
Copy link

@callinmullaney callinmullaney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets enable auto-fixing by default. From the plugins page Every rule supports autofixing (stylelint --fix).

@ModulesUnraveled
Copy link
Contributor

@callinmullaney I don't think we need to do anything here for that. If you look at the example scripts, there are lint scripts that show issues, and then a lint-fix script that fixes everything. Also, lint staged will auto fix everything anyway. https://github.com/fourkitchens/eslint-config-and-other-formatting/blob/main/package.json

@ryanhagerty
Copy link
Author

@callinmullaney Brian is correct - the npm command lint-fix will auto fix the property order.

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

Successfully merging this pull request may close these issues.

3 participants