diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3b8aa86..346585c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,12 +10,11 @@ jobs: fail-fast: false matrix: node-version: - - 16 - - 14 - - 12 + - 20 + - 18 steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - run: npm install diff --git a/index.js b/index.js index 99ad633..e5ea7cd 100644 --- a/index.js +++ b/index.js @@ -1,13 +1,13 @@ -'use strict'; - -module.exports = { +const config = { extends: 'stylelint-config-xo', rules: { indentation: [ 2, { - baseIndentLevel: 1 - } - ] - } + baseIndentLevel: 1, + }, + ], + }, }; + +export default config; diff --git a/package.json b/package.json index 89a6301..d5b39f1 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,11 @@ "email": "sindresorhus@gmail.com", "url": "https://sindresorhus.com" }, + "type": "module", + "exports": "./index.js", + "sideEffects": false, "engines": { - "node": ">=12" + "node": ">=18" }, "scripts": { "test": "xo && ava" @@ -46,14 +49,14 @@ "simple" ], "dependencies": { - "stylelint-config-xo": "^0.21.0" + "stylelint-config-xo": "^1.0.0" }, "devDependencies": { - "ava": "^2.4.0", - "stylelint": "^14.5.3", - "xo": "^0.33.1" + "ava": "^6.1.2", + "stylelint": "^16.4.0", + "xo": "^0.58.0" }, "peerDependencies": { - "stylelint": ">=14" + "stylelint": ">=16" } } diff --git a/test/test.js b/test/test.js index 3bbf7fe..7932268 100644 --- a/test/test.js +++ b/test/test.js @@ -1,21 +1,21 @@ import test from 'ava'; import stylelint from 'stylelint'; -import config from '..'; +import config from '../index.js'; const hasRule = (errors, ruleId) => errors.some(x => x.rule === ruleId); const runStylelint = async code => { const {results} = await stylelint.lint({ code, - config + config, }); for (const result of results) { - if (result.deprecations.length !== 0) { + if (result.deprecations.length > 0) { throw new Error(`Deprecations:\n${result.deprecations.join('\n')}`); } - if (result.invalidOptionWarnings.length !== 0) { + if (result.invalidOptionWarnings.length > 0) { const warnings = result.invalidOptionWarnings.map(x => x.text).join('\n'); throw new Error(`Invalid options:\n${warnings}`); } @@ -29,8 +29,8 @@ test('main', async t => { `div { left: .2em; } - ` + `, ); - t.true(hasRule(results[0].warnings, 'number-leading-zero')); + t.true(hasRule(results[0].warnings, '@stylistic/number-leading-zero')); });