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

[Fix] Support import-lazy bundler format #6449

Merged
merged 4 commits into from Nov 4, 2022
Merged
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: 5 additions & 0 deletions .changeset/poor-monkeys-begin.md
@@ -0,0 +1,5 @@
---
"stylelint": patch
---

Fixed: usage of the `import-lazy` package to fit bundlers
18 changes: 8 additions & 10 deletions lib/formatters/index.js
@@ -1,18 +1,16 @@
'use strict';

const _importLazy = require('import-lazy');

const importLazy = _importLazy(require);
const importLazy = require('import-lazy');

/** @type {typeof import('stylelint').formatters} */
const formatters = {
compact: importLazy('./compactFormatter'),
github: importLazy('./githubFormatter'),
json: importLazy('./jsonFormatter'),
string: importLazy('./stringFormatter'),
tap: importLazy('./tapFormatter'),
unix: importLazy('./unixFormatter'),
verbose: importLazy('./verboseFormatter'),
compact: importLazy(() => require('./compactFormatter'))(),
github: importLazy(() => require('./githubFormatter'))(),
json: importLazy(() => require('./jsonFormatter'))(),
string: importLazy(() => require('./stringFormatter'))(),
tap: importLazy(() => require('./tapFormatter'))(),
unix: importLazy(() => require('./unixFormatter'))(),
verbose: importLazy(() => require('./verboseFormatter'))(),
};

module.exports = formatters;