Skip to content

fix: explicitly import stylelint-order package#52

Merged
kutsan merged 3 commits intokutsan:masterfrom
canac:import-order-plugin
Feb 10, 2026
Merged

fix: explicitly import stylelint-order package#52
kutsan merged 3 commits intokutsan:masterfrom
canac:import-order-plugin

Conversation

@canac
Copy link
Contributor

@canac canac commented Feb 9, 2026

Thanks for a super useful package! Currently, using this config fails in Deno because stylelint looks for plugins referenced by string names in node_modules/, which isn't created by default in Deno.

Explicitly importing stylelint-order instead of referencing it by name fixes this in Deno.

Testing

Install deno, create this deno.json file, and run deno task stylelint it to see the error:

{
  "tasks": {
    "stylelint": "deno run --allow-all stylelint src/**/*.css"
  },
  "imports": {
    "stylelint": "npm:stylelint@^17.1.1",
    "stylelint-config-clean-order": "npm:stylelint-config-clean-order@^8.0.0",
    "stylelint-order": "npm:stylelint-order@^7.0.1"
  }
}

Then change it to the following and run deno task stylelint to verify the fix:

{
  "tasks": {
    "stylelint": "deno run --allow-all stylelint src/**/*.css"
  },
  "imports": {
    "stylelint": "npm:stylelint@^17.1.1",
    "stylelint-config-clean-order": "https://raw.githubusercontent.com/canac/stylelint-config-clean-order/import-order-plugin/src/index.ts",
    "stylelint-order": "npm:stylelint-order@^7.0.1"
  }
}

@canac canac requested a review from kutsan as a code owner February 9, 2026 22:27
@kutsan
Copy link
Owner

kutsan commented Feb 10, 2026

Thanks for the PR!

@canac
Copy link
Contributor Author

canac commented Feb 10, 2026

Thanks for the quick review!

By the way, I noticed that typescript isn't listed in package.json dependencies. The husky scripts were failing for me because I didn't have tsc installed locally. I had to add it to package.json, I just didn't commit those changes. Is it intentionally not in package.json? If not, let me know and I can add it too.

@kutsan
Copy link
Owner

kutsan commented Feb 10, 2026

By the way, I noticed that typescript isn't listed in package.json dependencies. The husky scripts were failing for me because I didn't have tsc installed locally. I had to add it to package.json, I just didn't commit those changes. Is it intentionally not in package.json? If not, let me know and I can add it too.

@canac We had done some work to convert the project to TypeScript but I think somehow we forgot to add TypeScript as a dev dependency. 😃 If you're motivated, you can add it and then we can merge the PR. If not, I can add it myself later. Thank you again for taking the time!

@canac
Copy link
Contributor Author

canac commented Feb 10, 2026

If you're motivated, you can add it and then we can merge the PR.

Done! Happy to help!

@kutsan kutsan merged commit 937bd13 into kutsan:master Feb 10, 2026
8 checks passed
@github-actions
Copy link
Contributor

🎉 This PR is included in version 8.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants