Skip to content

Commit

Permalink
Upgrade to Stylelint 16 and migrate to ESM (#352)
Browse files Browse the repository at this point in the history
  • Loading branch information
connor-baer authored Mar 3, 2024
1 parent 373cf60 commit 6d6ccf3
Show file tree
Hide file tree
Showing 8 changed files with 290 additions and 162 deletions.
5 changes: 5 additions & 0 deletions .changeset/twenty-pants-lay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'stylelint-config-recess-order': major
---

Upgrade to [Stylelint 16](https://stylelint.io/migration-guide/to-16/#removed-support-for-nodejs-less-than-18120) and migrate to ECMAScript modules (ESM). The minimum required Node.js version is 18.12.0.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion __tests__/index.mjs → __tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import test from 'ava'
import stylelint from 'stylelint'

import config from '../index.js'
import { correctOrder, incorrectOrder } from './_fixtures.mjs'
import { correctOrder, incorrectOrder } from './_fixtures.js'

const runStylelint = async (code) => {
let data = await stylelint.lint({
Expand Down
2 changes: 1 addition & 1 deletion groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -443,4 +443,4 @@ const propertyGroups = [
},
]

module.exports = propertyGroups
export default propertyGroups
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
const propertyGroups = require('./groups.js')
import propertyGroups from './groups.js'

module.exports = {
const config = {
plugins: ['stylelint-order'],
rules: {
'order/properties-order': propertyGroups,
},
}

export default config
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"name": "stylelint-config-recess-order",
"version": "4.6.0",
"description": "Recess-based property sort order for Stylelint.",
"type": "module",
"exports": "./index.js",
"keywords": [
"bootstrap",
"properties-order",
Expand Down Expand Up @@ -46,7 +48,7 @@
]
},
"dependencies": {
"stylelint-order": "6.x"
"stylelint-order": "^6.0.4"
},
"devDependencies": {
"@changesets/cli": "2.27.1",
Expand All @@ -59,10 +61,10 @@
"lint-staged": "15.2.2",
"prettier": "3.2.5",
"prettier-plugin-packagejson": "2.4.10",
"stylelint": "15.1.0",
"stylelint": "16.2.0",
"typescript": "4.9.5"
},
"peerDependencies": {
"stylelint": ">=15"
"stylelint": ">=16"
}
}
Loading

0 comments on commit 6d6ccf3

Please sign in to comment.