Skip to content
This repository was archived by the owner on Jul 19, 2023. It is now read-only.

Commit 137fd2d

Browse files
committed
Switch import for better auto completion
1 parent f187530 commit 137fd2d

File tree

3 files changed

+18
-17
lines changed

3 files changed

+18
-17
lines changed

html-validator.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55

66
// Types
77
export type AnalyzerOptions = ValidatorOptions;
8-
export type ReporterOptions = {
9-
maxMessageLen?: number,
10-
throwErrors?: boolean,
8+
export type ReporterSettings = {
9+
maxMessageLen: number,
10+
throwErrors: boolean,
1111
};
12+
export type ReporterOptions = Partial<ReporterSettings>;
1213

1314
// Imports
1415
import { Transform } from 'stream';

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,15 @@
8181
"dependencies": {
8282
"plugin-error": "~2.0",
8383
"through2": "~4.0",
84-
"vinyl": "~2.2",
84+
"vinyl": "~3.0",
8585
"w3c-html-validator": "~1.1"
8686
},
8787
"devDependencies": {
88-
"@types/node": "~18.7",
88+
"@types/node": "~18.8",
8989
"@types/through2": "~2.0",
90-
"@typescript-eslint/eslint-plugin": "~5.38",
91-
"@typescript-eslint/parser": "~5.38",
92-
"add-dist-header": "~0.2",
90+
"@typescript-eslint/eslint-plugin": "~5.39",
91+
"@typescript-eslint/parser": "~5.39",
92+
"add-dist-header": "~0.3",
9393
"assert-deep-strict-equal": "~1.0",
9494
"copy-file-util": "~0.1",
9595
"copy-folder-cli": "~0.1",
@@ -99,7 +99,7 @@
9999
"npm-run-all2": "~6.0",
100100
"rimraf": "~3.0",
101101
"sinon": "~14.0",
102-
"slash": "~4.0",
102+
"slash": "~5.0",
103103
"typescript": "~4.8"
104104
}
105105
}

spec/mocha.spec.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// Imports
44
import { assertDeepStrictEqual } from 'assert-deep-strict-equal';
5-
import { readdirSync, readFileSync } from 'fs';
5+
import fs from 'fs';
66
import Vinyl from 'vinyl';
77
import sinon from 'sinon';
88
import slash from 'slash';
@@ -11,7 +11,7 @@ import slash from 'slash';
1111
import { htmlValidator } from '../dist/html-validator.js';
1212
const analyzedFiles = { valid: [], invalid: [] };
1313
console.log(' Input HTML files for validation:');
14-
readdirSync('spec/html').forEach(file => console.log(' spec/html/' + file));
14+
fs.readdirSync('spec/html').forEach(file => console.log(' spec/html/' + file));
1515

1616
////////////////////////////////////////////////////////////////////////////////////////////////////
1717
describe('The gulp-w3c-html-validator analyzer()', () => {
@@ -21,7 +21,7 @@ describe('The gulp-w3c-html-validator analyzer()', () => {
2121
path: 'spec/html/valid.html',
2222
cwd: 'spec/',
2323
base: 'spec/html/',
24-
contents: readFileSync('spec/html/valid.html'),
24+
contents: fs.readFileSync('spec/html/valid.html'),
2525
};
2626
const mockFile = new Vinyl(vinylOptions);
2727
const stream = htmlValidator.analyzer();
@@ -44,7 +44,7 @@ describe('The gulp-w3c-html-validator analyzer()', () => {
4444
status: 200,
4545
messages: [],
4646
display: null,
47-
html: readFileSync('spec/html/valid.html').toString(),
47+
html: fs.readFileSync('spec/html/valid.html').toString(),
4848
},
4949
};
5050
if (process.platform === 'win32') //todo: ensure title is the same on all platforms
@@ -62,7 +62,7 @@ describe('The gulp-w3c-html-validator analyzer()', () => {
6262
path: 'spec/html/invalid.html',
6363
cwd: 'spec/',
6464
base: 'spec/html/',
65-
contents: readFileSync('spec/html/invalid.html'),
65+
contents: fs.readFileSync('spec/html/invalid.html'),
6666
};
6767
const mockFile = new Vinyl(vinylOptions);
6868
const stream = htmlValidator.analyzer();
@@ -97,7 +97,7 @@ describe('The analyzer() ignoreMessages option', () => {
9797
path: 'spec/html/invalid.html',
9898
cwd: 'spec/',
9999
base: 'spec/html/',
100-
contents: readFileSync('spec/html/invalid.html'),
100+
contents: fs.readFileSync('spec/html/invalid.html'),
101101
};
102102
const mockFile = new Vinyl(vinylOptions);
103103
const ignore = /^Element .blockquote. not allowed as child of element/;
@@ -134,7 +134,7 @@ describe('The gulp-w3c-html-validator reporter()', () => {
134134
path: 'spec/html/valid.html',
135135
cwd: 'spec/',
136136
base: 'spec/html/',
137-
contents: readFileSync('spec/html/valid.html'),
137+
contents: fs.readFileSync('spec/html/valid.html'),
138138
};
139139
const mockFile = new Vinyl(vinylOptions);
140140
const stream = htmlValidator.reporter();
@@ -162,7 +162,7 @@ describe('The gulp-w3c-html-validator reporter()', () => {
162162
path: 'spec/html/invalid.html',
163163
cwd: 'spec/',
164164
base: 'spec/html/',
165-
contents: readFileSync('spec/html/invalid.html'),
165+
contents: fs.readFileSync('spec/html/invalid.html'),
166166
w3cHtmlValidator: analyzedFiles.invalid[0].w3cHtmlValidator,
167167
};
168168
const mockFile = new Vinyl(vinylOptions);

0 commit comments

Comments
 (0)