Skip to content

Commit ba2b694

Browse files
committed
Merge branch 'refactor/more-node-import' into 'master'
misc refactor See merge request html-validate/html-validate!863
2 parents 2287fe7 + 0082aef commit ba2b694

File tree

88 files changed

+441
-687
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+441
-687
lines changed

docs/Gruntfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const path = require("path");
1+
const path = require("node:path");
22
const sass = require("sass");
33
const serveStatic = require("serve-static");
44

docs/dgeni/example/processors/generate-example-code.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const fs = require("fs");
2-
const path = require("path");
2+
const path = require("node:path");
33

44
/**
55
* @typedef {import("../services/example").Example} Example

docs/dgeni/inline-validate/processors/validate-generate-spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const path = require("path");
1+
const path = require("node:path");
22

33
/**
44
* @param {Map<string, unknown>} validateMap

docs/dgeni/inline-validate/processors/validate-parse.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const path = require("path");
1+
const path = require("node:path");
22

33
const VALIDATE_REGEX = /<validate([^>]*)>([\S\s]+?)<\/validate>/g;
44
const ATTRIBUTE_REGEX = /\s*([^=]+)\s*=\s*(?:(?:"([^"]+)")|(?:'([^']+)'))/g;

docs/dgeni/schema/processors/copy-schema-processor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const path = require("path");
1+
const path = require("node:path");
22
const fs = require("fs");
33

44
module.exports = function copySchemaProcessor(copySchema, readFilesProcessor) {

docs/guide/metadata/writing-tests.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Writing tests is as simple as using the HTML-Validate API configured with the me
99
The following example is using Jest but would be similar in other testing frameworks.
1010

1111
```ts
12-
import * as path from "path";
12+
import * as path from "node:path";
1313
import { HtmlValidate } from "html-validate";
1414

1515
const htmlvalidate = new HtmlValidate({
@@ -45,7 +45,7 @@ it("should give error when using <div> as content", async () => {
4545
When using Jest in particular there are helper functions to make it even easier:
4646

4747
```ts
48-
import * as path from "path";
48+
import * as path from "node:path";
4949
import { HtmlValidate } from "html-validate";
5050
import "html-validate/jest";
5151

docs/rules/__tests__/__snapshots__/attr-pattern.md.spec.ts.snap

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ exports[`docs/rules/attr-pattern.md inline validation: incorrect 1`] = `
1010
"messages": [
1111
{
1212
"column": 4,
13+
"context": {
14+
"attr": "foo_bar",
15+
"pattern": "[a-z0-9-:]+",
16+
},
1317
"line": 1,
1418
"message": "Attribute "foo_bar" should match /[a-z0-9-:]+/",
1519
"offset": 3,

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@
160160
"!src/html5.ts",
161161
"!src/cli/html-validate.ts",
162162
"!src/jest/jest.ts",
163+
"!src/utils/compatibility-check.browser.ts",
164+
"!src/utils/compatibility-check.nodejs.ts",
163165
"!**/__fixtures__/**"
164166
],
165167
"moduleNameMapper": {

rollup.base.config.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import fs from "fs";
2-
import path from "path";
2+
import path from "node:path";
33
import { fileURLToPath } from "node:url";
4-
import { builtinModules } from "module";
4+
import { builtinModules } from "node:module";
55
import { nodeResolve } from "@rollup/plugin-node-resolve";
66
import json from "@rollup/plugin-json"; //native solution coming: https://nodejs.org/docs/latest/api/esm.html#esm_json_modules
77
import replace from "@rollup/plugin-replace";
@@ -124,7 +124,7 @@ function manualChunks(id) {
124124
function generateResolved(format) {
125125
if (format === "es") {
126126
return `
127-
import { createRequire } from "module";
127+
import { createRequire } from "node:module";
128128
export const legacyRequire = createRequire(import.meta.url);
129129
`;
130130
} else {

scripts/codegen.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const fs = require("fs").promises;
2-
const path = require("path");
2+
const path = require("node:path");
33
const pkg = require("../package.json");
44

55
async function generatePackageTs() {

0 commit comments

Comments
 (0)