Closed risu729 closed 11 months ago
3.9.0
19.9.0
ES Modules (export default) doesn't work in markuplint.config.ts
export default
markuplint.config.ts
This relates to #948, but I think the cause is different.
It seems ESM is not supported at all by cosmiconfig-typescript-loader (bug: fails to load config in ESM project #60)
cosmiconfig-typescript-loader
I consider it necessary to fix the docs to avoid confusion. https://github.com/markuplint/markuplint/blob/8c7bdb69df903289126fd5e67ee962c193c3714c/website/docs/configuration/index.md#L70-L80
Run npx markuplint --config markuplint.config.ts --verbose test.html
npx markuplint --config markuplint.config.ts --verbose test.html
import type { Config } from '@markuplint/ml-config' const config: Config = { rules: { doctype: true, }, }; export default config
It fetches the specified config file but also contains other presets.
2023-04-30T15:33:16.201Z markuplint-cli:ml-engine:file Fetched Config files: Set(9) { '/workspaces/markuplint-test/markuplint.config.ts', 'markuplint:code-styles', 'markuplint:html-standard', 'markuplint:a11y', 'markuplint:performance', 'markuplint:security', 'markuplint:rdfa', 'markuplint:recommended', '0' }
It should fetch only one config file, as below.
2023-04-30T15:15:41.002Z markuplint-cli:ml-engine:file Fetched Config files: Set(1) { '/workspaces/markuplint-test/markuplint.config.js' }
It resolved in https://github.com/markuplint/markuplint/pull/1198
3.9.0
19.9.0
Describe the bug
ES Modules (
export default
) doesn't work inmarkuplint.config.ts
This relates to #948, but I think the cause is different.
It seems ESM is not supported at all by
cosmiconfig-typescript-loader
(bug: fails to load config in ESM project #60)I consider it necessary to fix the docs to avoid confusion. https://github.com/markuplint/markuplint/blob/8c7bdb69df903289126fd5e67ee962c193c3714c/website/docs/configuration/index.md#L70-L80
Code Example
Steps To Reproduce
Run
npx markuplint --config markuplint.config.ts --verbose test.html
The current behavior
It fetches the specified config file but also contains other presets.
The expected behavior
It should fetch only one config file, as below.