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

Migrate to ESM #931

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 2 additions & 3 deletions .eslintrc.json
@@ -1,11 +1,10 @@
{
"extends": ["eslint:recommended"],
"parserOptions": {
"sourceType": "script",
"ecmaVersion": 2020
"sourceType": "module"
},
"env": {
"es6": true,
"es2022": true,
"node": true
},
"rules": {
Expand Down
4 changes: 1 addition & 3 deletions jest-setup.js
@@ -1,6 +1,4 @@
"use strict";

const getTestRule = require("jest-preset-stylelint/getTestRule");
import { getTestRule } from "jest-preset-stylelint";

global.testRule = getTestRule({ plugins: ["./src"] });

Expand Down
10 changes: 6 additions & 4 deletions jest.config.js
@@ -1,6 +1,5 @@
"use strict";

module.exports = {
/** @satisfies {import('jest').Config} */
const config = {
preset: "jest-preset-stylelint",
clearMocks: true,
collectCoverage: false,
Expand All @@ -15,8 +14,11 @@ module.exports = {
statements: 75
}
},
setupFiles: ["./jest-setup.js"],
setupFiles: ["<rootDir>/jest-setup.js"],
runner: "jest-light-runner",
testEnvironment: "node",
roots: ["src"],
testRegex: ".*\\.test\\.js$|src/.*/__tests__/.*\\.js$"
};

export default config;