Skip to content

Commit

Permalink
Update stylelint to 16.0.0-3 and migrate test files to ESM
Browse files Browse the repository at this point in the history
  • Loading branch information
ybiquitous committed Nov 27, 2023
1 parent cb56627 commit 94af189
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 35 deletions.
6 changes: 3 additions & 3 deletions __tests__/engines.test.js → __tests__/engines.test.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';
import { execFileSync } from 'node:child_process';
import { readFileSync } from 'node:fs';

const { execFileSync } = require('child_process');
const pkg = require('../package.json');
const pkg = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'));

describe('engines.node', () => {
it("is the same as stylelint's one", () => {
Expand Down
8 changes: 3 additions & 5 deletions __tests__/index.test.js → __tests__/index.test.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
'use strict';

const config = require('../');
const fs = require('fs');
const stylelint = require('stylelint');
import config from '../index.js';
import fs from 'node:fs';
import stylelint from 'stylelint';

describe('flags no warnings with valid css', () => {
const validCss = fs.readFileSync('./__tests__/valid.css', 'utf-8');
Expand Down
116 changes: 93 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"lint": "npm-run-all --parallel lint:*",
"release": "np",
"pretest": "npm run lint",
"test": "jest",
"watch": "jest --watch"
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
"watch": "npm test --ignore-scripts -- --watch"
},
"lint-staged": {
"*.js": "eslint --cache --fix",
Expand All @@ -46,6 +46,9 @@
"@stylelint/remark-preset"
]
},
"jest": {
"testRegex": ".*\\.test\\.m?js$"
},
"dependencies": {
"stylelint-config-recommended": "github:stylelint/stylelint-config-recommended#prepare-14.0.0"
},
Expand All @@ -62,10 +65,10 @@
"npm-run-all": "^4.1.5",
"prettier": "^2.8.8",
"remark-cli": "^11.0.0",
"stylelint": "^16.0.0-0"
"stylelint": "^16.0.0-3"
},
"peerDependencies": {
"stylelint": "^16.0.0-0"
"stylelint": "^16.0.0-3"
},
"engines": {
"node": ">=18.12.0"
Expand Down

0 comments on commit 94af189

Please sign in to comment.