markuplint 4.0.0-alpha.4 → 4.0.0-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2017-2019 Yusuke Hirao
3
+ Copyright (c) 2017-2023 Yusuke Hirao
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -25,7 +25,7 @@
25
25
  $ npx markuplint target.html
26
26
  ```
27
27
 
28
- Supported for _Node.js_ `v14.6.0` or later.
28
+ Supported for _Node.js_ `v18.12.0` or later.
29
29
 
30
30
  ## Usage
31
31
 
@@ -1,2 +1,2 @@
1
- export { default as MLEngine, FromCodeOptions } from './ml-engine.js';
1
+ export { MLEngine, FromCodeOptions } from './ml-engine.js';
2
2
  export { lint } from './lint.js';
package/lib/api/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { default as MLEngine } from './ml-engine.js';
1
+ export { MLEngine } from './ml-engine.js';
2
2
  export { lint } from './lint.js';
package/lib/api/lint.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { resolveFiles } from '@markuplint/file-resolver';
2
- import MLEngine from './ml-engine.js';
2
+ import { MLEngine } from './ml-engine.js';
3
3
  export async function lint(targetList, options) {
4
4
  const res = [];
5
5
  const files = await resolveFiles(targetList);
@@ -12,7 +12,7 @@ export type FromCodeOptions = APIOptions & MLEngineOptions & {
12
12
  readonly name?: string;
13
13
  readonly dirname?: string;
14
14
  };
15
- export default class MLEngine extends Emitter<MLEngineEventMap> {
15
+ export declare class MLEngine extends Emitter<MLEngineEventMap> {
16
16
  #private;
17
17
  static fromCode(sourceCode: string, options?: FromCodeOptions): Promise<MLEngine>;
18
18
  static toMLFile(target: Target): Promise<MLFile | undefined>;
@@ -19,7 +19,7 @@ import { i18n } from '../i18n.js';
19
19
  const log = coreLog.extend('ml-engine');
20
20
  const fileLog = log.extend('file');
21
21
  const configLog = log.extend('config');
22
- class MLEngine extends Emitter {
22
+ export class MLEngine extends Emitter {
23
23
  static async fromCode(sourceCode, options) {
24
24
  if (options?.debug) {
25
25
  verbosely();
@@ -318,4 +318,3 @@ class MLEngine extends Emitter {
318
318
  }
319
319
  }
320
320
  _MLEngine_configProvider = new WeakMap(), _MLEngine_core = new WeakMap(), _MLEngine_file = new WeakMap(), _MLEngine_options = new WeakMap(), _MLEngine_watcher = new WeakMap();
321
- export default MLEngine;
package/lib/cli/index.js CHANGED
@@ -4,7 +4,7 @@ import { cli } from './bootstrap.js';
4
4
  import { command } from './command.js';
5
5
  import { createRule } from './create-rule/index.js';
6
6
  import { initialize } from './init/index.js';
7
- import search from './search/index.js';
7
+ import { search } from './search/index.js';
8
8
  /* eslint-disable unicorn/no-process-exit */
9
9
  if (cli.flags.v) {
10
10
  cli.showVersion(); // And exit successfully.
@@ -1,2 +1,2 @@
1
1
  import type { CLIOptions } from '../bootstrap.js';
2
- export default function (files: readonly string[], options: CLIOptions, selectors: string): Promise<void>;
2
+ export declare function search(files: readonly string[], options: CLIOptions, selectors: string): Promise<void>;
@@ -1,6 +1,6 @@
1
1
  import { createRule, MLRule } from '@markuplint/ml-core';
2
2
  import { command } from '../command.js';
3
- export default async function (files, options, selectors) {
3
+ export async function search(files, options, selectors) {
4
4
  const name = '__CLI_SEARCH__';
5
5
  const locations = [];
6
6
  await command(files, {
@@ -16,7 +16,7 @@ export function standardReporter(results, options) {
16
16
  }
17
17
  const out = [];
18
18
  if (results.violations.length > 0) {
19
- const lines = results.sourceCode.split(/\r?\n/g);
19
+ const lines = results.sourceCode.split(/\r?\n/);
20
20
  for (const violation of results.violations) {
21
21
  const prev = lines[violation.line - 2] ?? '';
22
22
  const line = lines[violation.line - 1] ?? '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "markuplint",
3
- "version": "4.0.0-alpha.4",
3
+ "version": "4.0.0-alpha.6",
4
4
  "description": "An HTML linter for all markup developers",
5
5
  "author": "Yusuke Hirao",
6
6
  "license": "MIT",
@@ -25,20 +25,20 @@
25
25
  "clean": "tsc --build --clean"
26
26
  },
27
27
  "dependencies": {
28
- "@markuplint/create-rule-helper": "4.0.0-alpha.4",
29
- "@markuplint/file-resolver": "4.0.0-alpha.4",
30
- "@markuplint/html-parser": "4.0.0-alpha.4",
31
- "@markuplint/html-spec": "4.0.0-alpha.4",
32
- "@markuplint/i18n": "4.0.0-alpha.4",
33
- "@markuplint/ml-ast": "4.0.0-alpha.4",
34
- "@markuplint/ml-config": "4.0.0-alpha.4",
35
- "@markuplint/ml-core": "4.0.0-alpha.4",
36
- "@markuplint/ml-spec": "4.0.0-alpha.4",
37
- "@markuplint/rules": "4.0.0-alpha.4",
38
- "@markuplint/shared": "4.0.0-alpha.4",
39
- "@types/cli-color": "^2.0.4",
40
- "@types/debug": "^4.1.10",
41
- "@types/uuid": "^9.0.6",
28
+ "@markuplint/create-rule-helper": "4.0.0-alpha.6",
29
+ "@markuplint/file-resolver": "4.0.0-alpha.6",
30
+ "@markuplint/html-parser": "4.0.0-alpha.6",
31
+ "@markuplint/html-spec": "4.0.0-alpha.6",
32
+ "@markuplint/i18n": "4.0.0-alpha.6",
33
+ "@markuplint/ml-ast": "4.0.0-alpha.6",
34
+ "@markuplint/ml-config": "4.0.0-alpha.6",
35
+ "@markuplint/ml-core": "4.0.0-alpha.6",
36
+ "@markuplint/ml-spec": "4.0.0-alpha.6",
37
+ "@markuplint/rules": "4.0.0-alpha.6",
38
+ "@markuplint/shared": "4.0.0-alpha.6",
39
+ "@types/cli-color": "^2.0.6",
40
+ "@types/debug": "^4.1.12",
41
+ "@types/uuid": "^9.0.7",
42
42
  "chokidar": "^3.5.3",
43
43
  "cli-color": "^2.0.3",
44
44
  "debug": "^4.3.4",
@@ -53,8 +53,8 @@
53
53
  "os-locale": "^6.0.2",
54
54
  "strict-event-emitter": "^0.5.1",
55
55
  "strip-ansi": "^7.1.0",
56
- "type-fest": "^4.5.0",
56
+ "type-fest": "^4.8.2",
57
57
  "uuid": "^9.0.1"
58
58
  },
59
- "gitHead": "991b3aef77fde42c79343ee8c807257a35c589d7"
59
+ "gitHead": "06e1242d274c72cf08a10a572b06ac35d1b924a4"
60
60
  }