@@ -21,12 +21,11 @@ import * as cache from "../lib/cache.mjs";
2121import * as constants from "../lib/constants.mjs" ;
2222import rules from "../lib/rules.mjs" ;
2323import customRules from "./rules/rules.cjs" ;
24- import { importWithTypeJson } from "./esm-helpers.mjs" ;
2524/** @type {{exports: Object.<string, string>, homepage: string, version: string} } */
26- const packageJson = await importWithTypeJson ( import . meta , "../package.json" ) ;
25+ import packageJson from "../package.json" with { "type" : "json" } ;
2726/** @type {{$id: string, properties: Object<string, Object>} } */
28- const configSchema = await importWithTypeJson ( import . meta , "../schema/markdownlint-config-schema.json" ) ;
29- const configSchemaStrict = await importWithTypeJson ( import . meta , "../schema/markdownlint-config-schema-strict.json" ) ;
27+ import configSchema from "../schema/markdownlint-config-schema.json" with { "type" : "json" } ;
28+ import configSchemaStrict from "../schema/markdownlint-config-schema-strict.json" with { "type" : "json" } ;
3029
3130const deprecatedRuleNames = new Set ( constants . deprecatedRuleNames ) ;
3231const ajvOptions = {
@@ -594,6 +593,7 @@ test("styleFiles", async(t) => {
594593 t . truthy ( require ( path . join ( "../style" , file ) ) , "Unable to load/parse." ) ;
595594 const exportValue = `./style/${ file } ` ;
596595 const exportKey = exportValue . replace ( / \. j s o n $ / , "" ) ;
596+ // @ts -ignore
597597 t . is ( packageJson . exports [ exportKey ] , exportValue ) ;
598598 }
599599} ) ;
@@ -1449,16 +1449,18 @@ test("token-map-spans", (t) => {
14491449 ) ;
14501450 for ( const token of inlines ) {
14511451 t . truthy ( token . map ) ;
1452- for ( let i = token . map [ 0 ] ; i < token . map [ 1 ] ; i ++ ) {
1453- if ( tokenLines . includes ( i ) ) {
1454- t . true (
1455- lastLineNumber === token . lineNumber ,
1456- `Line ${ i + 1 } is part of token maps from multiple lines.`
1457- ) ;
1458- } else {
1459- tokenLines . push ( i ) ;
1452+ if ( token . map ) {
1453+ for ( let i = token . map [ 0 ] ; i < token . map [ 1 ] ; i ++ ) {
1454+ if ( tokenLines . includes ( i ) ) {
1455+ t . true (
1456+ lastLineNumber === token . lineNumber ,
1457+ `Line ${ i + 1 } is part of token maps from multiple lines.`
1458+ ) ;
1459+ } else {
1460+ tokenLines . push ( i ) ;
1461+ }
1462+ lastLineNumber = token . lineNumber ;
14601463 }
1461- lastLineNumber = token . lineNumber ;
14621464 }
14631465 }
14641466 }
0 commit comments