4 |
--------------------------------------------------------------------------------
/packages/hint-compat-api/tests/fixtures/html/elements.html:
--------------------------------------------------------------------------------
1 |
...
2 |
3 |
4 |
--------------------------------------------------------------------------------
/packages/hint-compat-api/tests/fixtures/html/ignore.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Test
4 |
--------------------------------------------------------------------------------
/packages/hint-compat-api/tests/fixtures/html/values.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/packages/hint-content-type/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint-content-type/tests/fixtures/image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint-content-type/tests/fixtures/image.png
--------------------------------------------------------------------------------
/packages/hint-content-type/tests/fixtures/test.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint-content-type/tests/fixtures/test.woff2
--------------------------------------------------------------------------------
/packages/hint-create-element-svg/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint-create-element-svg/tests/fixtures/testjs.js:
--------------------------------------------------------------------------------
1 | document.getElementById('container').appendChild(document.createElement('svg'));
2 |
--------------------------------------------------------------------------------
/packages/hint-css-prefix-order/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint-css-prefix-order/tests/fixtures/cross-block.css:
--------------------------------------------------------------------------------
1 | .example1 {
2 | appearance: none;
3 | }
4 |
5 | .example2 {
6 | -moz-appearance: none;
7 | -webkit-appearance: none;
8 | }
9 |
--------------------------------------------------------------------------------
/packages/hint-css-prefix-order/tests/fixtures/different-property-at-end.css:
--------------------------------------------------------------------------------
1 | .example {
2 | appearance: none; /* Report */
3 | -webkit-appearance: none;
4 | background-size: cover;
5 | }
6 |
--------------------------------------------------------------------------------
/packages/hint-css-prefix-order/tests/fixtures/different-property-at-end.fixed.css:
--------------------------------------------------------------------------------
1 | .example {
2 | -webkit-appearance: none; /* Report */
3 | appearance: none;
4 | background-size: cover;
5 | }
6 |
--------------------------------------------------------------------------------
/packages/hint-css-prefix-order/tests/fixtures/interleaved-prefixes.css:
--------------------------------------------------------------------------------
1 | .example {
2 | -moz-appearance: none;
3 | appearance: none; /* Report */
4 | -webkit-appearance: none;
5 | }
6 |
--------------------------------------------------------------------------------
/packages/hint-css-prefix-order/tests/fixtures/interleaved-prefixes.fixed.css:
--------------------------------------------------------------------------------
1 | .example {
2 | -moz-appearance: none;
3 | -webkit-appearance: none; /* Report */
4 | appearance: none;
5 | }
6 |
--------------------------------------------------------------------------------
/packages/hint-css-prefix-order/tests/fixtures/mixed-with-prefixes-first.css:
--------------------------------------------------------------------------------
1 | .example {
2 | -moz-appearance: none;
3 | -webkit-appearance: none;
4 | background-color: #fff;
5 | appearance: none;
6 | }
7 |
--------------------------------------------------------------------------------
/packages/hint-css-prefix-order/tests/fixtures/mixed-with-prefixes-last.css:
--------------------------------------------------------------------------------
1 | .example {
2 | appearance: none; /* Report */
3 | background-color: #fff;
4 | -moz-appearance: none;
5 | -webkit-appearance: none;
6 | }
7 |
--------------------------------------------------------------------------------
/packages/hint-css-prefix-order/tests/fixtures/mixed-with-prefixes-last.fixed.css:
--------------------------------------------------------------------------------
1 | .example {
2 | -webkit-appearance: none; /* Report */
3 | background-color: #fff;
4 | -moz-appearance: none;
5 | appearance: none;
6 | }
7 |
--------------------------------------------------------------------------------
/packages/hint-css-prefix-order/tests/fixtures/multi-block.css:
--------------------------------------------------------------------------------
1 | .example1 {
2 | appearance: none; /* Report 1 */
3 | -moz-appearance: none;
4 | -webkit-appearance: none;
5 | }
6 |
7 | .example2 {
8 | appearance: none; /* Report 2 */
9 | -moz-appearance: none;
10 | -webkit-appearance: none;
11 | }
12 |
--------------------------------------------------------------------------------
/packages/hint-css-prefix-order/tests/fixtures/multi-property.css:
--------------------------------------------------------------------------------
1 | .example {
2 | appearance: none; /* Report 1 */
3 | -moz-appearance: none;
4 | -webkit-appearance: none;
5 | background-size: cover; /* Report 2 */
6 | -moz-background-size: cover;
7 | }
8 |
--------------------------------------------------------------------------------
/packages/hint-css-prefix-order/tests/fixtures/prefixed-only.css:
--------------------------------------------------------------------------------
1 | .example {
2 | -moz-appearance: none;
3 | -webkit-appearance: none;
4 | }
5 |
--------------------------------------------------------------------------------
/packages/hint-css-prefix-order/tests/fixtures/prefixed-values-first.css:
--------------------------------------------------------------------------------
1 | .example {
2 | display: -ms-grid;
3 | display: grid;
4 | }
5 |
--------------------------------------------------------------------------------
/packages/hint-css-prefix-order/tests/fixtures/prefixed-values-last.css:
--------------------------------------------------------------------------------
1 | .example {
2 | display: grid; /* Report */
3 | display: -ms-grid;
4 | }
5 |
--------------------------------------------------------------------------------
/packages/hint-css-prefix-order/tests/fixtures/prefixed-values-last.fixed.css:
--------------------------------------------------------------------------------
1 | .example {
2 | display: -ms-grid; /* Report */
3 | display: grid;
4 | }
5 |
--------------------------------------------------------------------------------
/packages/hint-css-prefix-order/tests/fixtures/prefixes-first-same-line.css:
--------------------------------------------------------------------------------
1 | .example { -moz-appearance: none; -webkit-appearance: none; appearance: none; }
2 |
--------------------------------------------------------------------------------
/packages/hint-css-prefix-order/tests/fixtures/prefixes-first.css:
--------------------------------------------------------------------------------
1 | .example {
2 | -moz-appearance: none;
3 | -webkit-appearance: none;
4 | appearance: none;
5 | }
6 |
--------------------------------------------------------------------------------
/packages/hint-css-prefix-order/tests/fixtures/prefixes-last-moz.css:
--------------------------------------------------------------------------------
1 | .example {
2 | appearance: none; /* Report */
3 | -webkit-appearance: none;
4 | -moz-appearance: none;
5 | }
6 |
--------------------------------------------------------------------------------
/packages/hint-css-prefix-order/tests/fixtures/prefixes-last-same-line.css:
--------------------------------------------------------------------------------
1 | .example { appearance: none; /* Report */ -moz-appearance: none; -webkit-appearance: none; }
2 |
--------------------------------------------------------------------------------
/packages/hint-css-prefix-order/tests/fixtures/prefixes-last-same-line.fixed.css:
--------------------------------------------------------------------------------
1 | .example { -webkit-appearance: none; /* Report */ -moz-appearance: none; appearance: none; }
2 |
--------------------------------------------------------------------------------
/packages/hint-css-prefix-order/tests/fixtures/prefixes-last-same-line.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/packages/hint-css-prefix-order/tests/fixtures/prefixes-last-webkit.css:
--------------------------------------------------------------------------------
1 | .example {
2 | appearance: none; /* Report */
3 | -moz-appearance: none;
4 | -webkit-appearance: none;
5 | }
6 |
--------------------------------------------------------------------------------
/packages/hint-css-prefix-order/tests/fixtures/prefixes-last-webkit.fixed.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/packages/hint-css-prefix-order/tests/fixtures/prefixes-last-webkit.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/packages/hint-css-prefix-order/tests/fixtures/prefixes-nested-blocks.scss:
--------------------------------------------------------------------------------
1 | .parent {
2 | .example {
3 | appearance: none; /* Report */
4 | -webkit-appearance: none;
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/packages/hint-css-prefix-order/tests/fixtures/unprefixed-only.css:
--------------------------------------------------------------------------------
1 | .example {
2 | appearance: none;
3 | }
4 |
--------------------------------------------------------------------------------
/packages/hint-detect-css-reflows/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint-detect-css-reflows/src/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @fileoverview description
3 | */
4 |
5 | import * as DetectCssCompositeHint from './composite';
6 | import * as DetectCssLayoutHint from './layout';
7 | import * as DetectCssPaintHint from './paint';
8 |
9 | /* eslint-disable quote-props */
10 |
11 | module.exports = {
12 | 'composite': DetectCssCompositeHint,
13 | 'layout': DetectCssLayoutHint,
14 | 'paint': DetectCssPaintHint
15 | };
16 |
--------------------------------------------------------------------------------
/packages/hint-detect-css-reflows/src/meta.ts:
--------------------------------------------------------------------------------
1 | /* eslint-disable quote-props */
2 |
3 | module.exports = {
4 | 'composite': require('./meta/composite'),
5 | 'layout': require('./meta/layout'),
6 | 'paint': require('./meta/paint')
7 | };
8 |
--------------------------------------------------------------------------------
/packages/hint-detect-css-reflows/tests/fixtures/composite-triggers.css:
--------------------------------------------------------------------------------
1 | .example1 {
2 | accent-color: red;
3 | }
4 |
5 | .example2 {
6 | align-content: last center;
7 | }
8 |
9 | @keyframes test {
10 | 50% {
11 | accent-color: blue;
12 | }
13 |
14 | 100% {
15 | align-content: last center;
16 | }
17 |
18 | test {
19 | not valid:{}
20 | }
21 | }
22 |
23 |
--------------------------------------------------------------------------------
/packages/hint-detect-css-reflows/tests/fixtures/layout-triggers.css:
--------------------------------------------------------------------------------
1 | .example1 {
2 | accent-color: red;
3 | }
4 |
5 | .example2 {
6 | padding-left: 10%;
7 | }
8 |
9 | @keyframes test {
10 | 50% {
11 | accent-color: blue;
12 | padding-left: 16%;
13 | }
14 |
15 | test {
16 | not valid:{}
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/packages/hint-detect-css-reflows/tests/fixtures/paint-triggers.css:
--------------------------------------------------------------------------------
1 | .example1 {
2 | accent-color: red;
3 | }
4 |
5 | .example2 {
6 | padding-left: 10%;
7 | }
8 |
9 | .example2 {
10 | appearance: textfield;
11 | }
12 |
13 | @keyframes test {
14 | 50% {
15 | accent-color: blue;
16 | padding-left: 16%;
17 | }
18 |
19 | test {
20 | not valid:{}
21 | }
22 |
23 | 75% {
24 | appearance: textfield;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/packages/hint-disown-opener/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint-doctype/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint-doctype/src/types.ts:
--------------------------------------------------------------------------------
1 | import { ProblemLocation } from '@hint/utils-types';
2 |
3 | export type MatchInformation = {
4 | matches: RegExpMatchArray | null;
5 | locations: ProblemLocation[];
6 | };
7 |
--------------------------------------------------------------------------------
/packages/hint-highest-available-document-mode/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint-html-checker/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint-http-cache/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint-http-compression/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint-http-compression/src/types.ts:
--------------------------------------------------------------------------------
1 | export type CompressionCheckOptions = {
2 | brotli: boolean;
3 | gzip: boolean;
4 | threshold: number; // bytes
5 | zopfli: boolean;
6 | };
7 |
--------------------------------------------------------------------------------
/packages/hint-http-compression/tests/fixtures/favicon.br:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint-http-compression/tests/fixtures/favicon.br
--------------------------------------------------------------------------------
/packages/hint-http-compression/tests/fixtures/favicon.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint-http-compression/tests/fixtures/favicon.gz
--------------------------------------------------------------------------------
/packages/hint-http-compression/tests/fixtures/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint-http-compression/tests/fixtures/favicon.ico
--------------------------------------------------------------------------------
/packages/hint-http-compression/tests/fixtures/favicon.zopfli.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint-http-compression/tests/fixtures/favicon.zopfli.gz
--------------------------------------------------------------------------------
/packages/hint-http-compression/tests/fixtures/image.br:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint-http-compression/tests/fixtures/image.br
--------------------------------------------------------------------------------
/packages/hint-http-compression/tests/fixtures/image.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint-http-compression/tests/fixtures/image.gz
--------------------------------------------------------------------------------
/packages/hint-http-compression/tests/fixtures/image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint-http-compression/tests/fixtures/image.png
--------------------------------------------------------------------------------
/packages/hint-http-compression/tests/fixtures/image.svgz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint-http-compression/tests/fixtures/image.svgz
--------------------------------------------------------------------------------
/packages/hint-http-compression/tests/fixtures/image.zopfli.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint-http-compression/tests/fixtures/image.zopfli.gz
--------------------------------------------------------------------------------
/packages/hint-http-compression/tests/fixtures/page.br:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint-http-compression/tests/fixtures/page.br
--------------------------------------------------------------------------------
/packages/hint-http-compression/tests/fixtures/page.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint-http-compression/tests/fixtures/page.gz
--------------------------------------------------------------------------------
/packages/hint-http-compression/tests/fixtures/page.zopfli.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint-http-compression/tests/fixtures/page.zopfli.gz
--------------------------------------------------------------------------------
/packages/hint-http-compression/tests/fixtures/script-small.br:
--------------------------------------------------------------------------------
1 | !0 const x = 5;
2 |
--------------------------------------------------------------------------------
/packages/hint-http-compression/tests/fixtures/script-small.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint-http-compression/tests/fixtures/script-small.gz
--------------------------------------------------------------------------------
/packages/hint-http-compression/tests/fixtures/script-small.js:
--------------------------------------------------------------------------------
1 | const x = 5;
2 |
--------------------------------------------------------------------------------
/packages/hint-http-compression/tests/fixtures/script-small.zopfli.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint-http-compression/tests/fixtures/script-small.zopfli.gz
--------------------------------------------------------------------------------
/packages/hint-http-compression/tests/fixtures/script.br:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint-http-compression/tests/fixtures/script.br
--------------------------------------------------------------------------------
/packages/hint-http-compression/tests/fixtures/script.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint-http-compression/tests/fixtures/script.gz
--------------------------------------------------------------------------------
/packages/hint-http-compression/tests/fixtures/script.zopfli.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint-http-compression/tests/fixtures/script.zopfli.gz
--------------------------------------------------------------------------------
/packages/hint-https-only/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint-https-only/tests/fixtures/nellie-studying.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint-https-only/tests/fixtures/nellie-studying.png
--------------------------------------------------------------------------------
/packages/hint-ie-flexbox-compat/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint-ie-flexbox-compat/tests/fixtures/inline.css:
--------------------------------------------------------------------------------
1 | body {
2 | display: inline-flex;
3 | }
4 |
--------------------------------------------------------------------------------
/packages/hint-ie-flexbox-compat/tests/fixtures/keyframe-rule.css:
--------------------------------------------------------------------------------
1 | @keyframes anim {
2 | from {
3 | display: block;
4 | }
5 |
6 | to {
7 | display: flex;
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/packages/hint-ie-flexbox-compat/tests/fixtures/multiple-displays-in-rule.css:
--------------------------------------------------------------------------------
1 | .rule {
2 | display: flex;
3 | color: red;
4 | display: flex;
5 | margin: 0;
6 | }
7 |
--------------------------------------------------------------------------------
/packages/hint-ie-flexbox-compat/tests/fixtures/multiple-displays.css:
--------------------------------------------------------------------------------
1 | .test {
2 | display: block;
3 | }
4 |
5 | .test.foo {
6 | display: none;
7 | }
8 |
9 | .fieldset {
10 | border: none;
11 | margin: 0;
12 | padding: 0;
13 | display: inline-flex;
14 | }
15 |
16 | .fieldset.bar {
17 | border: none;
18 | margin: 0;
19 | padding: 0;
20 | display: flex;
21 | }
22 |
--------------------------------------------------------------------------------
/packages/hint-ie-flexbox-compat/tests/fixtures/no-flex.css:
--------------------------------------------------------------------------------
1 | .foo {
2 | display: block;
3 | color: red;
4 | }
5 |
6 | .bar {
7 | display: inline-block;
8 | color: gold;
9 | }
10 |
11 | .baz {
12 | display: table;
13 | color: aquamarine;
14 | }
15 |
--------------------------------------------------------------------------------
/packages/hint-ie-flexbox-compat/tests/fixtures/simple.css:
--------------------------------------------------------------------------------
1 | body {
2 | display: flex;
3 | }
4 |
--------------------------------------------------------------------------------
/packages/hint-image-optimization-cloudinary/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint-image-optimization-cloudinary/tests/fixtures/nellie-studying.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint-image-optimization-cloudinary/tests/fixtures/nellie-studying.png
--------------------------------------------------------------------------------
/packages/hint-leading-dot-classlist/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint-leading-dot-classlist/tests/fixtures/test-failing-add.js:
--------------------------------------------------------------------------------
1 | document.getElementById('container').classList.add('.foo');
2 |
--------------------------------------------------------------------------------
/packages/hint-leading-dot-classlist/tests/fixtures/test-failing-remove.js:
--------------------------------------------------------------------------------
1 | document.getElementById('container').classList.remove('.foo');
2 |
--------------------------------------------------------------------------------
/packages/hint-leading-dot-classlist/tests/fixtures/test-irrelevant.js:
--------------------------------------------------------------------------------
1 | class Test {
2 | constructor(list = []) {
3 | this.list = list;
4 | }
5 |
6 | add(string) {
7 | this.list.push(string);
8 | }
9 |
10 | remove(string) {
11 | this.list = this.list.filter((entry) => entry !== string);
12 | }
13 | };
14 |
15 | const test = new Test();
16 | test.add(".foo");
17 | test.remove(".foo");
18 |
19 | const set = new Set();
20 | set.add('.foo');
21 |
--------------------------------------------------------------------------------
/packages/hint-leading-dot-classlist/tests/fixtures/test-passing.js:
--------------------------------------------------------------------------------
1 | document.getElementById('container').classList.add('foo');
2 | document.getElementById('container').classList.remove('foo');
3 |
--------------------------------------------------------------------------------
/packages/hint-manifest-app-name/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint-manifest-app-name/src/@types/punycode.d.ts:
--------------------------------------------------------------------------------
1 | declare module "punycode/punycode" {
2 | function decode(string: string): string;
3 | function encode(string: string): string;
4 | function toUnicode(domain: string): string;
5 | function toASCII(domain: string): string;
6 | const ucs2: ucs2;
7 | interface ucs2 {
8 | decode(string: string): number[];
9 | encode(codePoints: number[]): string;
10 | }
11 | const version: string;
12 | }
13 |
--------------------------------------------------------------------------------
/packages/hint-manifest-exists/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint-manifest-file-extension/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint-manifest-icons/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint-manifest-icons/tests/fixtures/empty-icons.webmanifest:
--------------------------------------------------------------------------------
1 | {
2 | "icons": []
3 | }
4 |
--------------------------------------------------------------------------------
/packages/hint-manifest-icons/tests/fixtures/icon-128x128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint-manifest-icons/tests/fixtures/icon-128x128.png
--------------------------------------------------------------------------------
/packages/hint-manifest-icons/tests/fixtures/icon-192x192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint-manifest-icons/tests/fixtures/icon-192x192.png
--------------------------------------------------------------------------------
/packages/hint-manifest-icons/tests/fixtures/icon-512x512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint-manifest-icons/tests/fixtures/icon-512x512.png
--------------------------------------------------------------------------------
/packages/hint-manifest-icons/tests/fixtures/icons-ok.webmanifest:
--------------------------------------------------------------------------------
1 | {
2 | "icons": [
3 | {
4 | "src": "fixtures/icon-192x192.png",
5 | "sizes": "192x192",
6 | "type": "image/png"
7 | },
8 | {
9 | "src": "fixtures/icon-512x512.png",
10 | "sizes": "512x512",
11 | "type": "image/png"
12 | }
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/packages/hint-manifest-icons/tests/fixtures/incorrect-type.webmanifest:
--------------------------------------------------------------------------------
1 | {
2 | "icons": [
3 | {
4 | "src": "fixtures/icon-192x192.png",
5 | "sizes": "192x192",
6 | "type": "image/jpg"
7 | },
8 | {
9 | "src": "fixtures/icon-512x512.png",
10 | "sizes": "512x512",
11 | "type": "image/png"
12 | }
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/packages/hint-manifest-icons/tests/fixtures/missing-size.webmanifest:
--------------------------------------------------------------------------------
1 | {
2 | "icons": [
3 | {
4 | "src": "fixtures/icon-192x192.png",
5 | "sizes": "192x192",
6 | "type": "image/png"
7 | }
8 | ]
9 | }
10 |
--------------------------------------------------------------------------------
/packages/hint-manifest-icons/tests/fixtures/missing-type.webmanifest:
--------------------------------------------------------------------------------
1 | {
2 | "icons": [
3 | {
4 | "src": "fixtures/icon-192x192.png",
5 | "sizes": "192x192"
6 | }
7 | ]
8 | }
9 |
--------------------------------------------------------------------------------
/packages/hint-manifest-icons/tests/fixtures/test.webmanifest:
--------------------------------------------------------------------------------
1 | {
2 | "icons": [
3 | {
4 | "src": "fixtures/icon-192x192.png",
5 | "sizes": "192x192",
6 | "type": "image/png"
7 | }
8 | ]
9 | }
10 |
--------------------------------------------------------------------------------
/packages/hint-manifest-is-valid/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint-manifest-is-valid/src/@types/bcp47.d.ts:
--------------------------------------------------------------------------------
1 | // https://github.com/gagle/node-bcp47
2 | declare module 'bcp47' {
3 | function parse(tag: string): {
4 | langtag: {
5 | language: {
6 | language: string;
7 | extlang: string[];
8 | };
9 | script: string;
10 | region: string;
11 | variant: string[];
12 | extension: string[];
13 | };
14 | };
15 | }
16 |
--------------------------------------------------------------------------------
/packages/hint-manifest-scoped-urls/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint-meta-charset-utf-8/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint-meta-charset-utf-8/tests/fixtures/repro.html:
--------------------------------------------------------------------------------
1 | {% load static %}
2 |
3 |
4 |
--------------------------------------------------------------------------------
/packages/hint-meta-theme-color/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint-meta-theme-color/images/no_theme-color.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint-meta-theme-color/images/no_theme-color.png
--------------------------------------------------------------------------------
/packages/hint-meta-theme-color/images/theme-color.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint-meta-theme-color/images/theme-color.png
--------------------------------------------------------------------------------
/packages/hint-meta-viewport/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint-meta-viewport/src/@types/metaviewport-parser.d.ts:
--------------------------------------------------------------------------------
1 | // https://github.com/dontcallmedom/metaviewport-parser
2 | declare module 'metaviewport-parser' {
3 | function parseMetaViewPortContent(content: string): {
4 | invalidValues: { [name: string]: string | number };
5 | unknownProperties: { [name: string]: string | number };
6 | validProperties: { [name: string]: string | number };
7 | };
8 | }
9 |
--------------------------------------------------------------------------------
/packages/hint-minified-js/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint-no-bom/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint-no-bom/tests/fixtures/bom.html:
--------------------------------------------------------------------------------
1 |
2 |
something
3 |
--------------------------------------------------------------------------------
/packages/hint-no-bom/tests/fixtures/no-bom.html:
--------------------------------------------------------------------------------
1 |
2 |
something
3 |
--------------------------------------------------------------------------------
/packages/hint-no-broken-links/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint-no-disallowed-headers/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint-no-friendly-error-pages/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint-no-html-only-headers/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint-no-http-redirects/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint-no-inline-styles/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint-no-p3p/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint-no-protocol-relative-urls/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint-no-protocol-relative-urls/tests/tests-http.ts:
--------------------------------------------------------------------------------
1 | import { getHintPath, testHint } from '@hint/utils-tests-helpers';
2 | import { Severity } from '@hint/utils-types';
3 | import { getTests } from './_generate-tests';
4 |
5 | const tests = getTests(Severity.warning);
6 |
7 | testHint(getHintPath(__filename), tests);
8 |
--------------------------------------------------------------------------------
/packages/hint-no-protocol-relative-urls/tests/tests-https.ts:
--------------------------------------------------------------------------------
1 | import { getHintPath, testHint } from '@hint/utils-tests-helpers';
2 | import { Severity } from '@hint/utils-types';
3 | import { getTests } from './_generate-tests';
4 |
5 | const tests = getTests(Severity.hint);
6 |
7 | testHint(getHintPath(__filename), tests, { https: true });
8 |
--------------------------------------------------------------------------------
/packages/hint-no-vulnerable-javascript-libraries/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint-no-vulnerable-javascript-libraries/scripts/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "allowJs": true,
4 | "alwaysStrict": true,
5 | "checkJs": true,
6 | "moduleResolution": "node",
7 | "noUnusedLocals": true,
8 | "resolveJsonModule": true,
9 | "strict": true,
10 | "target": "esnext"
11 | },
12 | "include": [
13 | "**/*.js"
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/packages/hint-performance-budget/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint-performance-budget/tests/fixtures/image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint-performance-budget/tests/fixtures/image.png
--------------------------------------------------------------------------------
/packages/hint-scoped-svg-styles/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint-sri/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint-sri/tests/fixtures/local-no-pass/test.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/packages/hint-sri/tests/fixtures/local-pass/test-relative.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/packages/hint-sri/tests/fixtures/local-pass/test.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/packages/hint-sri/tests/fixtures/scripts.js:
--------------------------------------------------------------------------------
1 | console.log('alert!');
2 |
--------------------------------------------------------------------------------
/packages/hint-sri/tests/fixtures/styles.css:
--------------------------------------------------------------------------------
1 | body {
2 | background: #000;
3 | }
4 |
--------------------------------------------------------------------------------
/packages/hint-ssllabs/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint-ssllabs/src/@types/node-ssllabs.d.ts:
--------------------------------------------------------------------------------
1 | declare module 'node-ssllabs';
2 |
--------------------------------------------------------------------------------
/packages/hint-strict-transport-security/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint-stylesheet-limits/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint-summary-display/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint-summary-display/tests/fixtures/summaryDefaultStyle.css:
--------------------------------------------------------------------------------
1 | summary {
2 | display: list-item;
3 | }
4 |
--------------------------------------------------------------------------------
/packages/hint-summary-display/tests/fixtures/summaryStyleChanged.css:
--------------------------------------------------------------------------------
1 | summary {
2 | display: block;
3 | }
4 |
--------------------------------------------------------------------------------
/packages/hint-summary-display/tests/fixtures/summaryTest1.css:
--------------------------------------------------------------------------------
1 | summary .foo {
2 | display: list-item;
3 | }
4 |
--------------------------------------------------------------------------------
/packages/hint-summary-display/tests/fixtures/summaryTest2.css:
--------------------------------------------------------------------------------
1 | summary.foo {
2 | display: flex;
3 | }
4 |
--------------------------------------------------------------------------------
/packages/hint-summary-display/tests/fixtures/summaryTest3.css:
--------------------------------------------------------------------------------
1 | summary, .myclass summary {
2 | display: block;
3 | }
4 |
--------------------------------------------------------------------------------
/packages/hint-summary-display/tests/fixtures/summaryTest4.css:
--------------------------------------------------------------------------------
1 | summary .myclass summary {
2 | display: block;
3 | }
4 |
--------------------------------------------------------------------------------
/packages/hint-summary-display/tests/fixtures/summaryTest5.css:
--------------------------------------------------------------------------------
1 | .myclass + summary {
2 | display: inline;
3 | }
4 |
--------------------------------------------------------------------------------
/packages/hint-summary-display/tests/fixtures/summaryTest6.css:
--------------------------------------------------------------------------------
1 | .myclass > summary {
2 | display: inline;
3 | }
4 |
--------------------------------------------------------------------------------
/packages/hint-summary-display/tests/fixtures/summaryTest7.css:
--------------------------------------------------------------------------------
1 | summary {
2 | max-width: 10px;
3 | }
4 |
--------------------------------------------------------------------------------
/packages/hint-typescript-config/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint-typescript-config/src/index.ts:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | 'consistent-casing': require('./consistent-casing'),
3 | 'import-helpers': require('./import-helpers'),
4 | 'is-valid': require('./is-valid'),
5 | 'no-comments': require('./no-comments'),
6 | strict: require('./strict'),
7 | target: require('./target')
8 | };
9 |
--------------------------------------------------------------------------------
/packages/hint-typescript-config/src/meta.ts:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | 'consistent-casing': require('./meta/consistent-casing'),
3 | 'import-helpers': require('./meta/import-helpers'),
4 | 'is-valid': require('./meta/is-valid'),
5 | 'no-comments': require('./meta/no-comments'),
6 | strict: require('./meta/strict'),
7 | target: require('./meta/target')
8 | };
9 |
--------------------------------------------------------------------------------
/packages/hint-typescript-config/tests/fixtures/circular-2/tsconfig.circular.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "module": "esnext"
4 | },
5 | "extends": "../circular/tsconfig.circular.json"
6 | }
7 |
--------------------------------------------------------------------------------
/packages/hint-typescript-config/tests/fixtures/circular/tsconfig.circular.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "module": "esnext"
4 | },
5 | "extends": "../circular-2/tsconfig.circular.json"
6 | }
7 |
--------------------------------------------------------------------------------
/packages/hint-typescript-config/tests/fixtures/extends-with-error/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "module": "esnext"
4 | },
5 | "extends": "../no-comments/invalid/tsconfig.json"
6 | }
7 |
--------------------------------------------------------------------------------
/packages/hint-typescript-config/tests/fixtures/invalid-extends/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "module": "esnext"
4 | },
5 | "extends": "../invalidjson/tsconfig.json"
6 | }
7 |
--------------------------------------------------------------------------------
/packages/hint-typescript-config/tests/fixtures/invalidjson/tsconfig.json:
--------------------------------------------------------------------------------
1 | invalidJson
2 |
--------------------------------------------------------------------------------
/packages/hint-typescript-config/tests/fixtures/no-compiler-options/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../no-comments/invalid/tsconfig.json"
3 | }
4 |
--------------------------------------------------------------------------------
/packages/hint-typescript-config/tests/fixtures/noconfig/text.txt:
--------------------------------------------------------------------------------
1 | This file is just to check that if there is no TypeScript config file, an event is 'parse::typescript-config::error::not-found' event is dispached.
2 |
--------------------------------------------------------------------------------
/packages/hint-typescript-config/tests/fixtures/target/config-package-json/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "browserslist": [
3 | "defaults",
4 | "maintained node versions"
5 | ]
6 | }
7 |
--------------------------------------------------------------------------------
/packages/hint-typescript-config/tests/fixtures/target/es2015/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "alwaysStrict": true,
4 | "declaration": true,
5 | "inlineSourceMap": true,
6 | "module": "commonjs",
7 | "newLine": "lf",
8 | "removeComments": false,
9 | "target": "es2015"
10 | },
11 | "exclude": [
12 | "dist",
13 | "node_modules",
14 | "packages"
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/packages/hint-typescript-config/tests/fixtures/target/es2016/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "alwaysStrict": true,
4 | "declaration": true,
5 | "inlineSourceMap": true,
6 | "module": "commonjs",
7 | "newLine": "lf",
8 | "removeComments": false,
9 | "target": "es2016"
10 | },
11 | "exclude": [
12 | "dist",
13 | "node_modules",
14 | "packages"
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/packages/hint-typescript-config/tests/fixtures/target/es3/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "alwaysStrict": true,
4 | "declaration": true,
5 | "inlineSourceMap": true,
6 | "module": "commonjs",
7 | "newLine": "lf",
8 | "removeComments": false,
9 | "target": "es3"
10 | },
11 | "exclude": [
12 | "dist",
13 | "node_modules",
14 | "packages"
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/packages/hint-typescript-config/tests/fixtures/target/es5/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "alwaysStrict": true,
4 | "declaration": true,
5 | "inlineSourceMap": true,
6 | "module": "commonjs",
7 | "newLine": "lf",
8 | "removeComments": false,
9 | "target": "es5"
10 | },
11 | "exclude": [
12 | "dist",
13 | "node_modules",
14 | "packages"
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/packages/hint-typescript-config/tests/fixtures/target/esnext/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "alwaysStrict": true,
4 | "declaration": true,
5 | "inlineSourceMap": true,
6 | "module": "commonjs",
7 | "newLine": "lf",
8 | "removeComments": false,
9 | "target": "esnext"
10 | },
11 | "exclude": [
12 | "dist",
13 | "node_modules",
14 | "packages"
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/packages/hint-typescript-config/tests/fixtures/target/extends-overrides/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es3"
4 | },
5 | "extends": "../es2016/tsconfig.json"
6 | }
7 |
--------------------------------------------------------------------------------
/packages/hint-typescript-config/tests/fixtures/target/extends/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../es2016/tsconfig.json"
3 | }
4 |
--------------------------------------------------------------------------------
/packages/hint-typescript-config/tests/fixtures/target/no-config-package-json/package.json:
--------------------------------------------------------------------------------
1 | {}
2 |
--------------------------------------------------------------------------------
/packages/hint-typescript-config/tests/fixtures/target/no-target-extends-target/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "alwaysStrict": true,
4 | "declaration": true,
5 | "inlineSourceMap": true,
6 | "module": "commonjs",
7 | "newLine": "lf",
8 | "removeComments": false
9 | },
10 | "exclude": [
11 | "dist",
12 | "node_modules",
13 | "packages"
14 | ],
15 | "extends": "../es3/tsconfig.json"
16 | }
17 |
--------------------------------------------------------------------------------
/packages/hint-typescript-config/tests/fixtures/target/no-target-extends/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "alwaysStrict": true,
4 | "declaration": true,
5 | "inlineSourceMap": true,
6 | "module": "commonjs",
7 | "newLine": "lf",
8 | "removeComments": false
9 | },
10 | "exclude": [
11 | "dist",
12 | "node_modules",
13 | "packages"
14 | ],
15 | "extends": "../no-target/tsconfig.json"
16 | }
17 |
--------------------------------------------------------------------------------
/packages/hint-typescript-config/tests/fixtures/target/no-target/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "alwaysStrict": true,
4 | "declaration": true,
5 | "inlineSourceMap": true,
6 | "module": "commonjs",
7 | "newLine": "lf",
8 | "removeComments": false
9 | },
10 | "exclude": [
11 | "dist",
12 | "node_modules",
13 | "packages"
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/packages/hint-validate-set-cookie-header/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint-validate-set-cookie-header/src/types.ts:
--------------------------------------------------------------------------------
1 | /** Parsed Set Cookie Header. */
2 |
3 | export type ParsedSetCookieHeader = {
4 | domain?: string;
5 | expires?: string;
6 | httponly?: boolean;
7 | 'max-age'?: string;
8 | name: string;
9 | path?: string;
10 | resource?: string;
11 | samesite?: boolean;
12 | secure?: boolean;
13 | value: string;
14 | };
15 |
--------------------------------------------------------------------------------
/packages/hint-webpack-config/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint-webpack-config/src/index.ts:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | 'is-installed': require('./is-installed'),
3 | 'is-valid': require('./is-valid'),
4 | 'module-esnext-typescript': require('./module-esnext-typescript'),
5 | 'modules-false-babel': require('./modules-false-babel'),
6 | 'no-devtool-in-prod': require('./no-devtool-in-prod')
7 | };
8 |
--------------------------------------------------------------------------------
/packages/hint-webpack-config/src/meta.ts:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | 'config-exists': require('./meta/config-exists'),
3 | 'is-installed': require('./meta/is-installed'),
4 | 'is-valid': require('./meta/is-valid'),
5 | 'module-esnext-typescript': require('./meta/module-esnext-typescript'),
6 | 'modules-false-babel': require('./meta/modules-false-babel'),
7 | 'no-devtool-in-prod': require('./meta/no-devtool-in-prod')
8 | };
9 |
--------------------------------------------------------------------------------
/packages/hint-webpack-config/tests/fixtures/.gitignore:
--------------------------------------------------------------------------------
1 | !node_modules
2 |
--------------------------------------------------------------------------------
/packages/hint-webpack-config/tests/fixtures/babelinvalid/node_modules/webpack/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "4.0.0"
3 | }
4 |
--------------------------------------------------------------------------------
/packages/hint-webpack-config/tests/fixtures/babelinvalid/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 |
3 | module.exports = {
4 | entry: ['entrypoint'],
5 | output: {
6 | filename: 'bundle.js',
7 | path: path.join(__dirname, 'dist')
8 | }
9 | };
10 |
--------------------------------------------------------------------------------
/packages/hint-webpack-config/tests/fixtures/babelvalid/node_modules/webpack/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "4.0.0"
3 | }
4 |
--------------------------------------------------------------------------------
/packages/hint-webpack-config/tests/fixtures/babelvalid/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 |
3 | module.exports = {
4 | entry: ['entrypoint'],
5 | output: {
6 | filename: 'bundle.js',
7 | path: path.join(__dirname, 'dist')
8 | }
9 | };
10 |
--------------------------------------------------------------------------------
/packages/hint-webpack-config/tests/fixtures/eval/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 |
3 | module.exports = {
4 | devtool: 'eval',
5 | entry: ['entrypoint'],
6 | output: {
7 | filename: 'bundle.js',
8 | path: path.join(__dirname, 'dist')
9 | }
10 | };
11 |
--------------------------------------------------------------------------------
/packages/hint-webpack-config/tests/fixtures/invalidconfig/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 |
3 | module.exports = {
4 | entry: 'entrypoint,
5 | output: {
6 | filename: 'bundle.js',
7 | path: path.join(__dirname, 'dist')
8 | }
9 | };
10 |
--------------------------------------------------------------------------------
/packages/hint-webpack-config/tests/fixtures/noconfig/text.txt:
--------------------------------------------------------------------------------
1 | This file is just to check that if there is no TypeScript config file, an event is 'parse::typescript-config::error::not-found' event is dispached.
--------------------------------------------------------------------------------
/packages/hint-webpack-config/tests/fixtures/noeval/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 |
3 | module.exports = {
4 | devtool: 'source-map',
5 | entry: ['entrypoint'],
6 | output: {
7 | filename: 'bundle.js',
8 | path: path.join(__dirname, 'dist')
9 | }
10 | };
11 |
--------------------------------------------------------------------------------
/packages/hint-webpack-config/tests/fixtures/tsinvalid/node_modules/webpack/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "4.0.0"
3 | }
4 |
--------------------------------------------------------------------------------
/packages/hint-webpack-config/tests/fixtures/tsinvalid/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "module": "commonjs"
4 | }
5 | }
--------------------------------------------------------------------------------
/packages/hint-webpack-config/tests/fixtures/tsinvalid/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 |
3 | module.exports = {
4 | entry: ['entrypoint'],
5 | output: {
6 | filename: 'bundle.js',
7 | path: path.join(__dirname, 'dist')
8 | }
9 | };
10 |
--------------------------------------------------------------------------------
/packages/hint-webpack-config/tests/fixtures/tsvalid/node_modules/webpack/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "4.0.0"
3 | }
4 |
--------------------------------------------------------------------------------
/packages/hint-webpack-config/tests/fixtures/tsvalid/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "module": "esnext"
4 | }
5 | }
--------------------------------------------------------------------------------
/packages/hint-webpack-config/tests/fixtures/tsvalid/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 |
3 | module.exports = {
4 | entry: ['entrypoint'],
5 | output: {
6 | filename: 'bundle.js',
7 | path: path.join(__dirname, 'dist')
8 | }
9 | };
10 |
--------------------------------------------------------------------------------
/packages/hint-webpack-config/tests/fixtures/valid/node_modules/webpack/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "4.0.0"
3 | }
4 |
--------------------------------------------------------------------------------
/packages/hint-webpack-config/tests/fixtures/valid/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 |
3 | module.exports = {
4 | entry: ['entrypoint'],
5 | output: {
6 | filename: 'bundle.js',
7 | path: path.join(__dirname, 'dist')
8 | }
9 | };
10 |
--------------------------------------------------------------------------------
/packages/hint-webpack-config/tests/fixtures/version1/node_modules/webpack/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "0.0.1"
3 | }
4 |
--------------------------------------------------------------------------------
/packages/hint-webpack-config/tests/fixtures/version1/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "module": "commonjs"
4 | }
5 | }
--------------------------------------------------------------------------------
/packages/hint-webpack-config/tests/fixtures/version1/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 |
3 | module.exports = {
4 | entry: ['entrypoint'],
5 | output: {
6 | filename: 'bundle.js',
7 | path: path.join(__dirname, 'dist')
8 | }
9 | };
10 |
--------------------------------------------------------------------------------
/packages/hint-x-content-type-options/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/hint/.nycrc:
--------------------------------------------------------------------------------
1 | {
2 | "branches": 75,
3 | "functions": 75
4 | }
5 |
--------------------------------------------------------------------------------
/packages/hint/docs/contributor-guide/getting-started/images/sequence.vsdx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint/docs/contributor-guide/getting-started/images/sequence.vsdx
--------------------------------------------------------------------------------
/packages/hint/docs/user-guide/concepts/images/codeframe.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint/docs/user-guide/concepts/images/codeframe.png
--------------------------------------------------------------------------------
/packages/hint/docs/user-guide/concepts/images/excel-details.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint/docs/user-guide/concepts/images/excel-details.png
--------------------------------------------------------------------------------
/packages/hint/docs/user-guide/concepts/images/excel-summary.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint/docs/user-guide/concepts/images/excel-summary.png
--------------------------------------------------------------------------------
/packages/hint/docs/user-guide/concepts/images/html-output.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint/docs/user-guide/concepts/images/html-output.png
--------------------------------------------------------------------------------
/packages/hint/docs/user-guide/concepts/images/json-output.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint/docs/user-guide/concepts/images/json-output.png
--------------------------------------------------------------------------------
/packages/hint/docs/user-guide/concepts/images/stylish-output.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint/docs/user-guide/concepts/images/stylish-output.png
--------------------------------------------------------------------------------
/packages/hint/docs/user-guide/concepts/images/summary-output.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint/docs/user-guide/concepts/images/summary-output.png
--------------------------------------------------------------------------------
/packages/hint/docs/user-guide/configuring-webhint/images/default-config.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint/docs/user-guide/configuring-webhint/images/default-config.png
--------------------------------------------------------------------------------
/packages/hint/docs/user-guide/development-flow-integration/images/access-control-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint/docs/user-guide/development-flow-integration/images/access-control-1.png
--------------------------------------------------------------------------------
/packages/hint/docs/user-guide/development-flow-integration/images/access-control-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint/docs/user-guide/development-flow-integration/images/access-control-2.png
--------------------------------------------------------------------------------
/packages/hint/docs/user-guide/development-flow-integration/images/deployment-credentials.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint/docs/user-guide/development-flow-integration/images/deployment-credentials.png
--------------------------------------------------------------------------------
/packages/hint/docs/user-guide/development-flow-integration/images/deployment-options-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint/docs/user-guide/development-flow-integration/images/deployment-options-1.png
--------------------------------------------------------------------------------
/packages/hint/docs/user-guide/development-flow-integration/images/deployment-options-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint/docs/user-guide/development-flow-integration/images/deployment-options-2.png
--------------------------------------------------------------------------------
/packages/hint/docs/user-guide/development-flow-integration/images/deployment-slots.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint/docs/user-guide/development-flow-integration/images/deployment-slots.png
--------------------------------------------------------------------------------
/packages/hint/docs/user-guide/development-flow-integration/images/slots-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint/docs/user-guide/development-flow-integration/images/slots-1.png
--------------------------------------------------------------------------------
/packages/hint/docs/user-guide/development-flow-integration/images/slots-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint/docs/user-guide/development-flow-integration/images/slots-2.png
--------------------------------------------------------------------------------
/packages/hint/docs/user-guide/development-flow-integration/images/slots-3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint/docs/user-guide/development-flow-integration/images/slots-3.png
--------------------------------------------------------------------------------
/packages/hint/docs/user-guide/images/summary-output.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint/docs/user-guide/images/summary-output.png
--------------------------------------------------------------------------------
/packages/hint/docs/user-guide/server-configurations/summary.md:
--------------------------------------------------------------------------------
1 | # Examples of server configurations
2 |
3 | Even though each hint has example on how to configure different server
4 | technologies, they only contain the relevant portions.
5 |
6 | The following are examples of basic server configurations to help you
7 | get started:
8 |
9 | * [Apache][apache config]
10 | * [IIS][iis config]
11 |
12 |
13 |
14 | [apache config]: ./apache.md
15 | [iis config]: ./iis.md
16 |
--------------------------------------------------------------------------------
/packages/hint/src/lib/@types/README.md:
--------------------------------------------------------------------------------
1 | # Type Definitions
2 |
3 | These are *partial* type definitions created to unblock usage by `hint`.
4 | As they are expanded to full definitions they should be contributed back
5 | to [DefinitelyTyped][DefinitelyTyped].
6 |
7 |
8 |
9 | [DefinitelyTyped]: https://github.com/DefinitelyTyped/DefinitelyTyped/
10 |
--------------------------------------------------------------------------------
/packages/hint/src/lib/cli/version.ts:
--------------------------------------------------------------------------------
1 | import { logger, loadHintPackage } from '@hint/utils';
2 |
3 | /** Prints the current hint version in the console. */
4 | export default (): Promise
=> {
5 |
6 | const pkg = loadHintPackage();
7 |
8 | logger.log(`v${pkg.version}`);
9 |
10 | return Promise.resolve(true);
11 | };
12 |
--------------------------------------------------------------------------------
/packages/hint/src/lib/enums/error-status.ts:
--------------------------------------------------------------------------------
1 | export enum AnalyzerErrorStatus {
2 | AnalyzeError = 'AnalyzeError',
3 | ConfigurationError = 'ConfigurationError',
4 | ConnectorError = 'ConnectorError',
5 | HintError = 'HintError',
6 | ResourceError = 'ResourceError'
7 | }
8 |
--------------------------------------------------------------------------------
/packages/hint/src/lib/enums/hint-scope.ts:
--------------------------------------------------------------------------------
1 | export enum HintScope {
2 | local = 'local',
3 | site = 'site',
4 | any = 'any'
5 | }
6 |
--------------------------------------------------------------------------------
/packages/hint/src/lib/enums/index.ts:
--------------------------------------------------------------------------------
1 | export * from './error-status';
2 | export * from './hint-scope';
3 |
--------------------------------------------------------------------------------
/packages/hint/src/lib/index.ts:
--------------------------------------------------------------------------------
1 | export * from './engine';
2 | export * from './analyzer';
3 | export * from './types';
4 | export * from './config';
5 | export * from './enums';
6 | export * from './hint-context';
7 |
8 | import * as allUtils from './utils';
9 |
10 | import { Analyzer } from './analyzer';
11 |
12 | export const utils = allUtils;
13 | export const createAnalyzer = Analyzer.create;
14 | export const getUserConfig = Analyzer.getUserConfig;
15 |
--------------------------------------------------------------------------------
/packages/hint/src/lib/types/event.ts:
--------------------------------------------------------------------------------
1 | export type Event = {
2 | /** The URL that emits the event */
3 | resource: string;
4 | };
5 |
--------------------------------------------------------------------------------
/packages/hint/src/lib/types/hints.ts:
--------------------------------------------------------------------------------
1 | import { HintContext } from '../hint-context';
2 | import { HintMetadata } from './hint-meta';
3 |
4 | export * from './hint-meta';
5 |
6 | /** A hint to be executed */
7 | export interface IHint { }
8 |
9 | export interface IHintConstructor {
10 | new(context: HintContext): IHint;
11 | meta: HintMetadata;
12 | }
13 |
--------------------------------------------------------------------------------
/packages/hint/src/lib/utils/index.ts:
--------------------------------------------------------------------------------
1 | import * as resourceLoaderUtils from './resource-loader';
2 |
3 | export * from './resource-loader';
4 |
5 | export const resourceLoader = resourceLoaderUtils;
6 |
--------------------------------------------------------------------------------
/packages/hint/tests/lib/fixtures/exception/package.json:
--------------------------------------------------------------------------------
1 | {
2 | private: true
3 | }
4 |
--------------------------------------------------------------------------------
/packages/hint/tests/lib/fixtures/getFilenameForDirectoryEmpty/.empty:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/hint/tests/lib/fixtures/getFilenameForDirectoryEmpty/.empty
--------------------------------------------------------------------------------
/packages/hint/tests/lib/fixtures/notvalid/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true
3 | }
4 |
--------------------------------------------------------------------------------
/packages/hint/tests/lib/fixtures/valid/array-hints.json:
--------------------------------------------------------------------------------
1 | {
2 | "connector": {
3 | "name": "chrome",
4 | "options": {
5 | "waitFor": 1000
6 | }
7 | },
8 | "formatters": [
9 | "json"
10 | ],
11 | "parsers": [
12 | "typescript"
13 | ],
14 | "hints": [
15 | "axe",
16 | "disallowed-headers",
17 | "https-only"
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/packages/hint/tests/lib/fixtures/valid/withextends.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": [
3 | "basics"
4 | ],
5 | "connector": {
6 | "name": "chrome",
7 | "options": {
8 | "waitFor": 1000
9 | }
10 | },
11 | "formatters": [
12 | "json"
13 | ],
14 | "parsers": [
15 | "typescript"
16 | ],
17 | "hints": {
18 | "disallowed-headers": "error"
19 | }
20 | }
--------------------------------------------------------------------------------
/packages/hint/tests/lib/fixtures/valid/withtwoextends.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": [
3 | "basics", "basics2"
4 | ],
5 | "connector": {
6 | "name": "chrome",
7 | "options": {
8 | "waitFor": 1000
9 | }
10 | },
11 | "parsers": [
12 | "typescript"
13 | ],
14 | "hints": {
15 | "disallowed-headers": "error"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/packages/hint/tests/lib/utils/fixtures/@example/webhint-connector-example/index.js:
--------------------------------------------------------------------------------
1 | console.log('connector');
2 |
--------------------------------------------------------------------------------
/packages/hint/tests/lib/utils/fixtures/@example/webhint-connector-example/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "main": "index.js",
3 | "name": "@example/webhint-connector-example",
4 | "private": true,
5 | "version": "1.0.0"
6 | }
7 |
--------------------------------------------------------------------------------
/packages/hint/tests/lib/utils/fixtures/connector1/index.js:
--------------------------------------------------------------------------------
1 | console.log('connector');
2 |
--------------------------------------------------------------------------------
/packages/hint/tests/lib/utils/fixtures/connector1/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@hint/installedconnector1",
3 | "version": "0.0.1",
4 | "main": "index.js",
5 | "author": "",
6 | "description": ""
7 | }
8 |
--------------------------------------------------------------------------------
/packages/hint/tests/lib/utils/fixtures/connector2/index.js:
--------------------------------------------------------------------------------
1 | console.log('connector');
2 |
--------------------------------------------------------------------------------
/packages/hint/tests/lib/utils/fixtures/connector2/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@hint/installedconnector2",
3 | "version": "0.0.1",
4 | "main": "index.js",
5 | "author": "",
6 | "description": ""
7 | }
8 |
--------------------------------------------------------------------------------
/packages/hint/tests/lib/utils/fixtures/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "test"
3 | }
4 |
--------------------------------------------------------------------------------
/packages/parser-babel-config/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/parser-babel-config/tests/fixtures/invalid/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | presets
3 | }
4 |
--------------------------------------------------------------------------------
/packages/parser-babel-config/tests/fixtures/valid-with-extends-invalid/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../invalid/.babelrc",
3 | "presets": [
4 | [
5 | "env",
6 | {
7 | "targets": {
8 | "browsers": [
9 | "last 2 versions",
10 | "> 5% in BE"
11 | ],
12 | "uglify": false
13 | },
14 | "modules": false
15 | }
16 | ]
17 | ]
18 | }
--------------------------------------------------------------------------------
/packages/parser-babel-config/tests/fixtures/valid-with-extends-loop-2/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../valid-with-extends-loop/.babelrc",
3 | "presets": [
4 | [
5 | "env",
6 | {
7 | "targets": {
8 | "browsers": [
9 | "last 2 versions",
10 | "> 5% in BE"
11 | ],
12 | "uglify": false
13 | },
14 | "modules": false
15 | }
16 | ]
17 | ]
18 | }
--------------------------------------------------------------------------------
/packages/parser-babel-config/tests/fixtures/valid-with-extends-loop/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../valid-with-extends-loop-2/.babelrc",
3 | "presets": [
4 | [
5 | "env",
6 | {
7 | "targets": {
8 | "browsers": [
9 | "last 2 versions",
10 | "> 5% in BE"
11 | ],
12 | "uglify": false
13 | },
14 | "modules": false
15 | }
16 | ]
17 | ]
18 | }
--------------------------------------------------------------------------------
/packages/parser-babel-config/tests/fixtures/valid-with-extends/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../valid/.babelrc",
3 | "presets": [
4 | [
5 | "env",
6 | {
7 | "targets": {
8 | "browsers": [
9 | "last 2 versions",
10 | "> 5% in BE"
11 | ],
12 | "uglify": false
13 | },
14 | "modules": false
15 | }
16 | ]
17 | ]
18 | }
--------------------------------------------------------------------------------
/packages/parser-css/tests/helpers/mocks.ts:
--------------------------------------------------------------------------------
1 | import { HTMLElement } from '@hint/utils-dom';
2 |
3 | export const mockStyleElement = (type: string, code: string) => {
4 | return {
5 | getAttribute() {
6 | return type;
7 | },
8 | innerHTML: code
9 | } as Partial as HTMLElement;
10 | };
11 |
--------------------------------------------------------------------------------
/packages/parser-html/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/parser-html/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "outDir": "dist",
4 | "strict": true
5 | },
6 | "exclude": [
7 | "dist",
8 | "node_modules"
9 | ],
10 | "extends": "../../tsconfig.json",
11 | "include": [
12 | "src/**/*.ts",
13 | "tests/**/*.ts"
14 | ],
15 | "references": [
16 | { "path": "../hint" },
17 | { "path": "../utils-dom" }
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/packages/parser-javascript/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/parser-jsx/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/parser-less/tests/fixtures/test.less:
--------------------------------------------------------------------------------
1 | .test {
2 | display: block;
3 |
4 | &:after {
5 | transition-duration: 1s;
6 | -webkit-transition-duration: 1s;
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/packages/parser-less/tests/helpers/mocks.ts:
--------------------------------------------------------------------------------
1 | import { HTMLElement } from '@hint/utils-dom';
2 |
3 | export const mockStyleElement = (type: string | null, code: string) => {
4 | return {
5 | getAttribute(name: string) {
6 | return name === 'type' ? type : null;
7 | },
8 | innerHTML: code
9 | } as Partial as HTMLElement;
10 | };
11 |
--------------------------------------------------------------------------------
/packages/parser-manifest/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/parser-package-json/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/parser-package-json/tests/fixtures/valid/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "app",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "author": "",
10 | "license": "ISC",
11 | "dependencies": {
12 | "extend": "3.0.2"
13 | },
14 | "devDependencies": {
15 | "gulp": "^4.0.0"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/packages/parser-sass/tests/helpers/mocks.ts:
--------------------------------------------------------------------------------
1 | import { HTMLElement } from '@hint/utils-dom';
2 |
3 | export const mockStyleElement = (lang: 'sass' | 'scss' | null, code: string) => {
4 | return {
5 | getAttribute(name: string) {
6 | return name === 'lang' ? lang : null;
7 | },
8 | innerHTML: code
9 | } as Partial as HTMLElement;
10 | };
11 |
--------------------------------------------------------------------------------
/packages/parser-typescript-config/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/parser-typescript-config/tests/fixtures/tsconfig.invalid.json:
--------------------------------------------------------------------------------
1 | {invalidJson}
2 |
--------------------------------------------------------------------------------
/packages/parser-typescript-config/tests/fixtures/tsconfig.valid-with-extends-invalid.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "module": "esnext"
4 | },
5 | "extends": "./tsconfig.invalid.json"
6 | }
7 |
--------------------------------------------------------------------------------
/packages/parser-typescript-config/tests/fixtures/tsconfig.valid-with-extends-loop-2.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "module": "esnext"
4 | },
5 | "extends": "./tsconfig.valid-with-extends-loop.json"
6 | }
7 |
--------------------------------------------------------------------------------
/packages/parser-typescript-config/tests/fixtures/tsconfig.valid-with-extends-loop.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "module": "esnext"
4 | },
5 | "extends": "./tsconfig.valid-with-extends-loop-2.json"
6 | }
7 |
--------------------------------------------------------------------------------
/packages/parser-typescript-config/tests/fixtures/tsconfig.valid-with-extends.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "module": "esnext"
4 | },
5 | "extends": "./tsconfig.valid.json"
6 | }
7 |
--------------------------------------------------------------------------------
/packages/parser-typescript/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/parser-webpack-config/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/parser-webpack-config/tests/fixtures/invalid-config/webpack.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | entry: "./s
3 | output: {
4 | path: path.join(__dirnamea),
5 | filename: "bundle.js"
6 | }
7 | };
--------------------------------------------------------------------------------
/packages/parser-webpack-config/tests/fixtures/valid/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 |
3 | module.exports = {
4 | entry: './src',
5 | output: {
6 | filename: 'bundle.js',
7 | path: path.join(__dirname, 'dist')
8 | }
9 | };
10 |
--------------------------------------------------------------------------------
/packages/utils-compat-data/.gitignore:
--------------------------------------------------------------------------------
1 | src/browser-compat-data.ts
2 | src/mdn-css-types.ts
3 |
--------------------------------------------------------------------------------
/packages/utils-compat-data/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/utils-compat-data/scripts/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "allowJs": true,
4 | "alwaysStrict": true,
5 | "checkJs": true,
6 | "moduleResolution": "node",
7 | "noUnusedLocals": true,
8 | "resolveJsonModule": true,
9 | "strict": true,
10 | "target": "esnext"
11 | },
12 | "include": [
13 | "**/*.js"
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/packages/utils-compat-data/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from './support';
2 |
--------------------------------------------------------------------------------
/packages/utils-compat-data/src/matches.ts:
--------------------------------------------------------------------------------
1 | import { CompatStatement } from '@mdn/browser-compat-data/types';
2 |
3 | export interface IMatchesCompatStatement extends CompatStatement {
4 | matches?: IMatchesBlock;
5 | match?: IMatchesBlock;
6 | }
7 |
8 | export interface IMatchesBlock {
9 | keywords?: string[];
10 | regex_token?: string; // eslint-disable-line camelcase
11 | regex_value?: string; // eslint-disable-line camelcase
12 | }
13 |
--------------------------------------------------------------------------------
/packages/utils-compat-data/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "outDir": "dist",
4 | "strict": true
5 | },
6 | "exclude": [
7 | "dist",
8 | "node_modules"
9 | ],
10 | "extends": "../../tsconfig.json",
11 | "include": [
12 | "src/**/*.ts",
13 | "tests/**/*.ts"
14 | ],
15 | "references": [
16 | { "path": "../utils-css" }
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/packages/utils-connector-tools/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/utils-connector-tools/src/@types/browserslist.d.ts:
--------------------------------------------------------------------------------
1 | declare module 'browserslist' {
2 | function browserslist(match?: string | string[]): string[];
3 | export = browserslist;
4 | }
5 |
--------------------------------------------------------------------------------
/packages/utils-connector-tools/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from './normalize-headers';
2 | export * from './redirects';
3 | export * from './requester';
4 | export * from './resolver';
5 | export * from './requester-options';
6 |
--------------------------------------------------------------------------------
/packages/utils-connector-tools/src/requester-options.ts:
--------------------------------------------------------------------------------
1 | import * as fetch from 'node-fetch';
2 |
3 | export interface IRequestOptions extends fetch.RequestInit {
4 | rejectUnauthorized?: boolean;
5 | strictSSL?: boolean;
6 | }
7 |
--------------------------------------------------------------------------------
/packages/utils-create-server/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/utils-create-server/src/generate-html-page.ts:
--------------------------------------------------------------------------------
1 | /** Creates a valid minimal HTML. */
2 | export const generateHTMLPage = (head: string = 'test', body: string = ''): string => {
3 | return `
4 |
5 |
6 | ${head}
7 |
8 |
9 | ${body}
10 |
11 | `;
12 | };
13 |
--------------------------------------------------------------------------------
/packages/utils-css/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/utils-css/src/get-unprefixed.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Returns the input property with the vendor prefix removed.
3 | * NOTE: This code is extracted from the package postcss because
4 | * they have removed this features from their code.
5 | * @param {string} prop Property to remove the prefix.
6 | * @returns {string} String without the vendor prefix.
7 | */
8 | export const getUnprefixed = (prop: string): string => {
9 | return prop.replace(/^-\w+-/, '');
10 | };
11 |
--------------------------------------------------------------------------------
/packages/utils-css/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from './get-css-code-snippet';
2 | export * from './get-css-location-from-node';
3 | export * from './get-vendor-prefix';
4 | export * from './get-unprefixed';
5 |
--------------------------------------------------------------------------------
/packages/utils-css/tests/get-unprefixed.ts:
--------------------------------------------------------------------------------
1 | import { getUnprefixed } from '../src/get-unprefixed';
2 | import test from 'ava';
3 |
4 | test(`Returns vendor prefix`, (t) => {
5 | const expected = 'animation';
6 |
7 | t.is(getUnprefixed('-moz-animation'), expected);
8 | });
9 |
--------------------------------------------------------------------------------
/packages/utils-css/tests/get-vendor-prefix.ts:
--------------------------------------------------------------------------------
1 | import { getVendorPrefix } from '../src/get-vendor-prefix';
2 | import test from 'ava';
3 |
4 | test(`Returns vendor prefix`, (t) => {
5 | const expected = '-moz-';
6 |
7 | t.is(getVendorPrefix('-moz-animation'), expected);
8 | });
9 |
--------------------------------------------------------------------------------
/packages/utils-css/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "outDir": "dist",
4 | "rootDir": ".",
5 | "strict": true
6 | },
7 | "exclude": [
8 | "dist",
9 | "node_modules"
10 | ],
11 | "extends": "../../tsconfig.json",
12 | "include": [
13 | "src/**/*.ts",
14 | "tests/**/*.ts"
15 | ],
16 | "references": [
17 | { "path": "../utils-types" }
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/packages/utils-debug/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/utils-debug/README.md:
--------------------------------------------------------------------------------
1 | # Debug utils (`@hint/utils-debug`)
2 |
3 | Set of helpers to print debug messages in webhint
4 |
5 | ## Installation
6 |
7 | This package is installed automatically when adding webhint to your project
8 | so running the following is enough:
9 |
10 | ```bash
11 | npm install hint --save-dev
12 | ```
13 |
14 | ## Utils
15 |
16 | * `debug`: Initialize the debug messaging system.
17 |
--------------------------------------------------------------------------------
/packages/utils-debug/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "outDir": "dist",
4 | "rootDir": ".",
5 | "strict": true
6 | },
7 | "exclude": [
8 | "dist",
9 | "node_modules"
10 | ],
11 | "extends": "../../tsconfig.json",
12 | "include": [
13 | "src/**/*.ts",
14 | "tests/**/*.ts"
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/packages/utils-dom/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/utils-dom/src/comment.ts:
--------------------------------------------------------------------------------
1 | import { CharacterData } from './characterdata';
2 |
3 | /**
4 | * https://developer.mozilla.org/docs/Web/API/Comment
5 | */
6 | export class Comment extends CharacterData { }
7 |
--------------------------------------------------------------------------------
/packages/utils-dom/src/documenttype.ts:
--------------------------------------------------------------------------------
1 | import { Node } from './node';
2 |
3 | /**
4 | * https://developer.mozilla.org/docs/Web/API/DocumentType
5 | */
6 | export class DocumentType extends Node { }
7 |
--------------------------------------------------------------------------------
/packages/utils-dom/src/elements/htmlbodyelement.ts:
--------------------------------------------------------------------------------
1 | import { HTMLElement } from '../htmlelement';
2 |
3 | /**
4 | * https://developer.mozilla.org/docs/Web/API/HTMLBodyElement
5 | */
6 | export class HTMLBodyElement extends HTMLElement { }
7 |
--------------------------------------------------------------------------------
/packages/utils-dom/src/elements/htmlhtmlelement.ts:
--------------------------------------------------------------------------------
1 | import { HTMLElement } from '../htmlelement';
2 |
3 | /**
4 | * https://developer.mozilla.org/docs/Web/API/HTMLHtmlElement
5 | */
6 | export class HTMLHtmlElement extends HTMLElement { }
7 |
--------------------------------------------------------------------------------
/packages/utils-dom/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from './create-html-document';
2 | export * from './find-original-element';
3 | export * from './get-element-by-url';
4 | export * from './get-html-code-snippet';
5 | export * from './globals';
6 | export * from './htmldocument';
7 | export * from './htmlelement';
8 | export * from './snapshot';
9 | export * from './traverse';
10 | export * from './types';
11 |
--------------------------------------------------------------------------------
/packages/utils-dom/src/text.ts:
--------------------------------------------------------------------------------
1 | import { CharacterData } from './characterdata';
2 |
3 | /**
4 | * https://developer.mozilla.org/docs/Web/API/Text
5 | */
6 | export class Text extends CharacterData { }
7 |
--------------------------------------------------------------------------------
/packages/utils-dom/tests/fixtures/serialized-test-html.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Title
6 | This is the content
7 |
8 |
9 |
--------------------------------------------------------------------------------
/packages/utils-dom/tests/fixtures/test-html.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Title
8 | This is the content
9 |
10 |
11 |
--------------------------------------------------------------------------------
/packages/utils-fs/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/utils-fs/src/cwd.ts:
--------------------------------------------------------------------------------
1 | /** Returns the current working directory. Same as `process.cwd()`. */
2 | export const cwd = (): string => {
3 | return process.cwd();
4 | };
5 |
--------------------------------------------------------------------------------
/packages/utils-fs/src/file-name.ts:
--------------------------------------------------------------------------------
1 | import { basename } from 'path';
2 |
3 | /** Try to determine the resource's file name. */
4 | export const fileName = (resource: string) => {
5 | return basename(resource);
6 | };
7 |
--------------------------------------------------------------------------------
/packages/utils-fs/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from './cwd';
2 | export * from './file-extension';
3 | export * from './file-name';
4 | export * from './is-directory';
5 | export * from './is-file';
6 | export * from './load-js-file';
7 | export * from './load-json-file';
8 | export * from './path-exists';
9 | export * from './read-file';
10 | export * from './read-file-async';
11 | export * from './write-file-async';
12 |
--------------------------------------------------------------------------------
/packages/utils-fs/src/is-directory.ts:
--------------------------------------------------------------------------------
1 | import { statSync } from 'fs';
2 |
3 | /** Check if a path is a directory and exists. */
4 | export const isDirectory = (directoryPath: string): boolean => {
5 | try {
6 | const stat = statSync(directoryPath);
7 |
8 | return stat.isDirectory();
9 | } catch (e) {
10 | return false;
11 | }
12 | };
13 |
--------------------------------------------------------------------------------
/packages/utils-fs/src/is-file.ts:
--------------------------------------------------------------------------------
1 | import { statSync } from 'fs';
2 |
3 | /** Check if a path is a file and exists. */
4 | export const isFile = (filePath?: string): boolean => {
5 | try {
6 | const stats = statSync(filePath!);
7 |
8 | return stats.isFile();
9 | } catch (e) {
10 | return false;
11 | }
12 | };
13 |
--------------------------------------------------------------------------------
/packages/utils-fs/src/load-js-file.ts:
--------------------------------------------------------------------------------
1 | /* eslint-disable no-process-env */
2 | /** Loads a JavaScript file. */
3 | export const loadJSFile = (filePath: string): any => {
4 | let file;
5 |
6 | /* istanbul ignore if */
7 | if (process.env.webpack) {
8 | // @ts-ignore
9 | file = __non_webpack_require__(filePath);
10 | } else {
11 | file = require(filePath);
12 | }
13 |
14 | return file;
15 | };
16 |
--------------------------------------------------------------------------------
/packages/utils-fs/src/path-exists.ts:
--------------------------------------------------------------------------------
1 | import { statSync } from 'fs';
2 |
3 | /** Check if a path exists. */
4 | export const pathExists = (pathString: string): boolean => {
5 | try {
6 | const stats = statSync(pathString);
7 |
8 | return stats.isDirectory();
9 | } catch (e) {
10 | return false;
11 | }
12 | };
13 |
--------------------------------------------------------------------------------
/packages/utils-fs/src/read-file.ts:
--------------------------------------------------------------------------------
1 | import { readFileSync } from 'fs';
2 |
3 | /** Convenience wrapper for synchronously reading file contents. */
4 | export const readFile = (filePath: string): string => {
5 | const content = readFileSync(filePath, 'utf8');
6 |
7 | if (content[0] === '\uFEFF') {
8 | return content.substr(1);
9 | }
10 |
11 | return content;
12 | };
13 |
--------------------------------------------------------------------------------
/packages/utils-fs/src/write-file-async.ts:
--------------------------------------------------------------------------------
1 | /* istanbul ignore file */
2 |
3 | import { writeFile } from 'fs';
4 | import { promisify } from 'util';
5 |
6 | /** Convenience wrapper for asynchronously write a file. */
7 | export const writeFileAsync = async (filePath: string, data: string): Promise => {
8 | await promisify(writeFile)(filePath, data, { encoding: 'utf8' });
9 | };
10 |
--------------------------------------------------------------------------------
/packages/utils-fs/tests/cwd.ts:
--------------------------------------------------------------------------------
1 | import test from 'ava';
2 |
3 | import { cwd } from '../src';
4 |
5 | test('cwd has to return the same as process.cwd', (t) => {
6 | const expected = process.cwd();
7 |
8 | t.is(cwd(), expected);
9 | });
10 |
--------------------------------------------------------------------------------
/packages/utils-fs/tests/file-name.ts:
--------------------------------------------------------------------------------
1 | import * as path from 'path';
2 |
3 | import test from 'ava';
4 |
5 | import { fileName } from '../src';
6 |
7 | test('fileName has to return the same as path.basename', (t) => {
8 | const pathString = '/mnt/test/image.png';
9 | const expected = path.basename(pathString);
10 |
11 | t.is(fileName(pathString), expected);
12 | });
13 |
--------------------------------------------------------------------------------
/packages/utils-fs/tests/fixtures/bom.txt:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/packages/utils-fs/tests/fixtures/dummy.txt:
--------------------------------------------------------------------------------
1 | dummy
--------------------------------------------------------------------------------
/packages/utils-fs/tests/fixtures/empty.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/utils-fs/tests/fixtures/empty.txt
--------------------------------------------------------------------------------
/packages/utils-fs/tests/fixtures/fixture.js:
--------------------------------------------------------------------------------
1 | module.exports = { property1: 'value1' };
2 |
--------------------------------------------------------------------------------
/packages/utils-fs/tests/fixtures/fixture.json:
--------------------------------------------------------------------------------
1 | {
2 | "property1": "value1"
3 | }
4 |
--------------------------------------------------------------------------------
/packages/utils-fs/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "outDir": "dist",
4 | "rootDir": ".",
5 | "strict": true
6 | },
7 | "exclude": [
8 | "dist",
9 | "node_modules"
10 | ],
11 | "extends": "../../tsconfig.json",
12 | "include": [
13 | "src/**/*.ts",
14 | "tests/**/*.ts"
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/packages/utils-i18n/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/utils-i18n/src/get-category-name.ts:
--------------------------------------------------------------------------------
1 | import { Category } from '@hint/utils-types';
2 | import { getMessage } from './i18n.import';
3 |
4 | export const getCategoryName = (category: Category, language = 'en') => {
5 | return getMessage(category, language);
6 | };
7 |
--------------------------------------------------------------------------------
/packages/utils-i18n/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from './format';
2 | export * from './get-category-name';
3 | export * from './get-message';
4 |
--------------------------------------------------------------------------------
/packages/utils-i18n/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "outDir": "dist",
4 | "rootDir": ".",
5 | "strict": true
6 | },
7 | "exclude": [
8 | "dist",
9 | "node_modules"
10 | ],
11 | "extends": "../../tsconfig.json",
12 | "include": [
13 | "src/**/*.ts",
14 | "tests/**/*.ts"
15 | ],
16 | "references": [
17 | { "path": "../utils-types" }
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/packages/utils-json/.gitignore:
--------------------------------------------------------------------------------
1 | !tests/fixtures/node_modules
2 | !.gitignore
--------------------------------------------------------------------------------
/packages/utils-json/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/utils-json/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from './final-config';
2 | export * from './parse-json';
3 | export * from './schema-validator';
4 | export * from './types';
5 |
--------------------------------------------------------------------------------
/packages/utils-json/tests/fixtures/baseConfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@tsconfig/strictest/tsconfig.json"
3 | }
--------------------------------------------------------------------------------
/packages/utils-json/tests/fixtures/baseConfigCircular.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./baseConfigCircular.json"
3 | }
--------------------------------------------------------------------------------
/packages/utils-json/tests/fixtures/fixture.json:
--------------------------------------------------------------------------------
1 | {
2 | "property1": "value1"
3 | }
4 |
--------------------------------------------------------------------------------
/packages/utils-json/tests/fixtures/node_modules/@tsconfig/strictest/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "noImplicitAny": true,
4 | "strictNullChecks": true,
5 | "E2ETestingValue": true
6 | }
7 | }
--------------------------------------------------------------------------------
/packages/utils-network/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/utils-network/src/capitalize-header-name.ts:
--------------------------------------------------------------------------------
1 | import { toPascalCase } from '@hint/utils-string';
2 |
3 | /**
4 | * Capitalize a header name.
5 | *
6 | * e.g:
7 | * content-type => Content-Type
8 | */
9 | export const capitalizeHeaderName = (headerName: string) => {
10 | const parts = headerName.split('-').map((partialName) => {
11 | return toPascalCase(partialName);
12 | });
13 |
14 | return parts.join('-');
15 | };
16 |
--------------------------------------------------------------------------------
/packages/utils-network/src/has-protocol.ts:
--------------------------------------------------------------------------------
1 | import { URL } from 'url';
2 |
3 | /** Convenience function to check if a resource uses a specific protocol. */
4 | export const hasProtocol = (resource: string, protocol: string): boolean => {
5 | return new URL(resource).protocol === protocol;
6 | };
7 |
--------------------------------------------------------------------------------
/packages/utils-network/src/is-data-uri.ts:
--------------------------------------------------------------------------------
1 | import { hasProtocol } from './has-protocol';
2 |
3 | /** Convenience function to check if a resource is a data URI. */
4 | export const isDataURI = (resource: string): boolean => {
5 | return hasProtocol(resource, 'data:');
6 | };
7 |
--------------------------------------------------------------------------------
/packages/utils-network/src/is-http.ts:
--------------------------------------------------------------------------------
1 | import { hasProtocol } from './has-protocol';
2 |
3 | // Convenience function to check if a resource is served over HTTP.
4 | export const isHTTP = (resource: string): boolean => {
5 | return hasProtocol(resource, 'http:');
6 | };
7 |
--------------------------------------------------------------------------------
/packages/utils-network/src/is-https.ts:
--------------------------------------------------------------------------------
1 | import { hasProtocol } from './has-protocol';
2 |
3 | /** Convenience function to check if a resource is served over HTTPS. */
4 | export const isHTTPS = (resource: string): boolean => {
5 | return hasProtocol(resource, 'https:');
6 | };
7 |
--------------------------------------------------------------------------------
/packages/utils-network/src/is-local-file.ts:
--------------------------------------------------------------------------------
1 | import { hasProtocol } from './has-protocol';
2 |
3 | /** Convenience function to check if a resource is a local file. */
4 | export const isLocalFile = (resource: string): boolean => {
5 | return hasProtocol(resource, 'file:');
6 | };
7 |
--------------------------------------------------------------------------------
/packages/utils-network/src/request-json-async.ts:
--------------------------------------------------------------------------------
1 | import { requestAsync } from './request-async';
2 |
3 | /** Request response in the json format from an endpoint. */
4 | export const requestJSONAsync = (uri: string, options: object): Promise => {
5 | const params = {
6 | headers: { 'Content-Type': 'application/json' },
7 | ...options
8 | };
9 |
10 | return requestAsync(uri, params);
11 | };
12 |
--------------------------------------------------------------------------------
/packages/utils-network/src/rx-local-file.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * RegExp to test if a resource is loaded from a local file.
3 | */
4 | export const rxLocalFile = /^file:\/\/.*/;
5 |
--------------------------------------------------------------------------------
/packages/utils-network/src/rx-localhost.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * RegExp to test if a resource points to the local host.
3 | * Identifies both localhost and 127.0.0.1 URLs.
4 | */
5 | export const rxLocalhost = /^https?:\/\/(localhost|127\.0\.0\.1)[:/]/;
6 |
--------------------------------------------------------------------------------
/packages/utils-network/tests/capitalize-header-name.ts:
--------------------------------------------------------------------------------
1 | import test from 'ava';
2 |
3 | import { capitalizeHeaderName } from '../src';
4 |
5 | test('capitalizeHeaderName should capitalize a header with a simple word', (t) => {
6 | t.is(capitalizeHeaderName('vary'), 'Vary');
7 | });
8 |
9 | test('capitalizeHeaderName should capitalize a header with a compose word', (t) => {
10 | t.is(capitalizeHeaderName('content-type'), 'Content-Type');
11 | });
12 |
--------------------------------------------------------------------------------
/packages/utils-network/tests/fixtures/empty.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webhintio/hint/76264f7733c74f3f0a9d94652fe1cd6a60ea9be9/packages/utils-network/tests/fixtures/empty.txt
--------------------------------------------------------------------------------
/packages/utils-network/tests/is-http.ts:
--------------------------------------------------------------------------------
1 | import test from 'ava';
2 |
3 | import { isHTTP } from '../src';
4 |
5 | test('isHTTP detects if the URL is HTTP or not', (t) => {
6 | const noHttpUri = 'https://myresource.com/';
7 | const httpUri = 'http://somethinghere';
8 |
9 | t.false(isHTTP(noHttpUri), `isHTTP doesn't detect correctly ${noHttpUri} is not a HTTP URI`);
10 | t.true(isHTTP(httpUri), `isHTTP doesn't detect correctly ${httpUri} is a HTTP URI`);
11 | });
12 |
--------------------------------------------------------------------------------
/packages/utils-network/tests/is-https.ts:
--------------------------------------------------------------------------------
1 | import test from 'ava';
2 |
3 | import { isHTTPS } from '../src';
4 |
5 | test('isHTTPS detects if the URL is HTTP or not', (t) => {
6 | const noHttpsUri = 'http://myresource.com/';
7 | const httpsUri = 'https://somethinghere';
8 |
9 | t.false(isHTTPS(noHttpsUri), `isHTTPS doesn't detect correctly ${noHttpsUri} is not a HTTPS URI`);
10 | t.true(isHTTPS(httpsUri), `isHTTPS doesn't detect correctly ${httpsUri} is a HTTPS URI`);
11 | });
12 |
--------------------------------------------------------------------------------
/packages/utils-string/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/utils-string/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from './cut-string';
2 | export * from './merge-ignore-include-arrays';
3 | export * from './normalize-includes';
4 | export * from './normalize-string-by-delimiter';
5 | export * from './normalize-string';
6 | export * from './pretty-print-array';
7 | export * from './to-camel-case';
8 | export * from './to-lowercase-array';
9 | export * from './to-lowercase-keys';
10 | export * from './to-pascal-case';
11 |
--------------------------------------------------------------------------------
/packages/utils-string/src/normalize-includes.ts:
--------------------------------------------------------------------------------
1 | import { normalizeString } from './normalize-string';
2 |
3 | /** Return if normalized `source` string includes normalized `included` string. */
4 | export const normalizeIncludes = (source: string, included: string) => {
5 | return normalizeString(source)!.includes(normalizeString(included)!);
6 | };
7 |
--------------------------------------------------------------------------------
/packages/utils-string/src/normalize-string-by-delimiter.ts:
--------------------------------------------------------------------------------
1 | import { normalizeString } from './normalize-string';
2 |
3 | /** Normalize String and then replace characters with delimiter. */
4 | export const normalizeStringByDelimiter = (value: string, delimiter: string) => {
5 | return normalizeString(value)!.replace(/[^a-z0-9]/gi, delimiter);
6 | };
7 |
--------------------------------------------------------------------------------
/packages/utils-string/src/to-lowercase-array.ts:
--------------------------------------------------------------------------------
1 | /** Lower cases all the items of `list`. */
2 | export const toLowerCaseArray = (list: string[]): string[] => {
3 | return list.map((e) => {
4 | return e.toLowerCase();
5 | });
6 | };
7 |
--------------------------------------------------------------------------------
/packages/utils-string/src/to-lowercase-keys.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Returns the same object but with all the properties lower cased. This is
3 | * helpful when working with `headers`.
4 | */
5 | export const toLowerCaseKeys = (obj: any) => {
6 | const entries = Object.entries(obj);
7 |
8 | return entries.reduce((lowerCased, [key, value]) => {
9 | lowerCased[key.toLowerCase()] = value;
10 |
11 | return lowerCased;
12 | }, {} as any);
13 | };
14 |
--------------------------------------------------------------------------------
/packages/utils-string/src/to-pascal-case.ts:
--------------------------------------------------------------------------------
1 | /** Convert '-' delimitered string to pascal case name. */
2 | export const toPascalCase = (value: string) => {
3 | return value.split('-').reduce((accu: string, w: string) => {
4 | let current = accu;
5 |
6 | current += w.length ? `${w.charAt(0).toUpperCase()}${w.substr(1).toLowerCase()}` : '';
7 |
8 | return current;
9 | }, '');
10 | };
11 |
--------------------------------------------------------------------------------
/packages/utils-string/tests/to-camel-case.ts:
--------------------------------------------------------------------------------
1 | import test from 'ava';
2 |
3 | import { toCamelCase } from '../src';
4 |
5 | test('toCamelCase transforms a - separated string to camelCase', (t) => {
6 | const source = 'this-is-a-string';
7 | const expected = 'thisIsAString';
8 | const transformed = toCamelCase(source);
9 |
10 | t.is(transformed, expected, `${transformed} !== ${expected}`);
11 | });
12 |
--------------------------------------------------------------------------------
/packages/utils-string/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "outDir": "dist",
4 | "rootDir": ".",
5 | "strict": true
6 | },
7 | "exclude": [
8 | "dist",
9 | "node_modules"
10 | ],
11 | "extends": "../../tsconfig.json",
12 | "include": [
13 | "src/**/*.ts",
14 | "tests/**/*.ts"
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/packages/utils-tests-helpers/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/utils-tests-helpers/README.md:
--------------------------------------------------------------------------------
1 | # Tests helpers (`@hint/utils-tests-helpers`)
2 |
3 | Set of helpers to run tests in webhint
4 |
5 | ## Installation
6 |
7 | This package is installed automatically when adding webhint to your project
8 | so running the following is enough:
9 |
10 | ```bash
11 | npm install hint --save-dev
12 | ```
13 |
14 | ### Utils
15 |
16 | * `getHintPath`: Returns the name of the hint.
17 |
--------------------------------------------------------------------------------
/packages/utils-tests-helpers/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from './get-hint-path';
2 | export * from './hint-test-type';
3 | export * from './hint-runner';
4 |
--------------------------------------------------------------------------------
/packages/utils-types/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/utils-types/src/category.ts:
--------------------------------------------------------------------------------
1 | export enum Category {
2 | accessibility = 'accessibility',
3 | development = 'development',
4 | compatibility = 'compatibility',
5 | other = 'other',
6 | pwa = 'pwa',
7 | performance = 'performance',
8 | pitfalls = 'pitfalls',
9 | security = 'security'
10 | }
11 |
--------------------------------------------------------------------------------
/packages/utils-types/src/fix.ts:
--------------------------------------------------------------------------------
1 | import { ProblemLocation } from './problem-location';
2 |
3 | export type CodeFix = {
4 | location: ProblemLocation;
5 | text: string;
6 | }
7 |
--------------------------------------------------------------------------------
/packages/utils-types/src/http-headers.ts:
--------------------------------------------------------------------------------
1 | export type HttpHeaders = {
2 | [name: string]: string | undefined; // TODO: include `string[]`
3 | };
4 |
--------------------------------------------------------------------------------
/packages/utils-types/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from './category';
2 | export * from './http-headers';
3 | export * from './problem-documentation';
4 | export * from './problem-location';
5 | export * from './problems';
6 | export * from './severity';
7 | export * from './fix';
8 |
--------------------------------------------------------------------------------
/packages/utils-types/src/problem-documentation.ts:
--------------------------------------------------------------------------------
1 | export type ProblemDocumentation = {
2 | /** Link to the documentation */
3 | link: string;
4 | /** Text to show in the link */
5 | text: string;
6 | };
7 |
--------------------------------------------------------------------------------
/packages/utils-types/src/severity.ts:
--------------------------------------------------------------------------------
1 | /** The severity configuration of a hint */
2 | export enum Severity {
3 | off = 0,
4 | information = 1,
5 | hint = 2,
6 | warning = 3,
7 | error = 4,
8 | default = 5
9 | }
10 |
--------------------------------------------------------------------------------
/packages/utils-types/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "outDir": "dist",
4 | "rootDir": ".",
5 | "strict": true
6 | },
7 | "exclude": [
8 | "dist",
9 | "node_modules"
10 | ],
11 | "extends": "../../tsconfig.json",
12 | "include": [
13 | "src/**/*.ts",
14 | "tests/**/*.ts"
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/packages/utils-worker/.eslintignore:
--------------------------------------------------------------------------------
1 | coverage
2 | dist
3 | webhint.js
4 |
--------------------------------------------------------------------------------
/packages/utils-worker/.gitignore:
--------------------------------------------------------------------------------
1 | # Autogenerated imports for hints and hint metadata
2 | *.import.ts
3 |
4 | # webpack's bundled stats file
5 | stats.json
6 |
7 | # built localization files
8 | _locales
9 |
10 | # built worker bundle
11 | webhint.js
12 |
--------------------------------------------------------------------------------
/packages/utils-worker/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/utils-worker/scripts/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "allowJs": true,
4 | "alwaysStrict": true,
5 | "checkJs": true,
6 | "moduleResolution": "node",
7 | "noUnusedLocals": true,
8 | "resolveJsonModule": true,
9 | "strict": true,
10 | "target": "esnext"
11 | },
12 | "include": [
13 | "**/*.js"
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/packages/utils-worker/src/@types/browserslist.d.ts:
--------------------------------------------------------------------------------
1 | declare module 'browserslist' {
2 | function browserslist(match?: string | string[]): string[];
3 | export = browserslist;
4 | }
5 |
--------------------------------------------------------------------------------
/packages/utils-worker/src/_locales/en/messages.json:
--------------------------------------------------------------------------------
1 | {
2 | "hintsTitle": {
3 | "message": "Hints",
4 | "description": "Title displayed for the tool tab."
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/packages/utils-worker/src/shims/acorn-jsx-walk.ts:
--------------------------------------------------------------------------------
1 | export const extend = () => {};
2 |
--------------------------------------------------------------------------------
/packages/utils-worker/src/shims/acorn-jsx.ts:
--------------------------------------------------------------------------------
1 | export = null;
2 |
--------------------------------------------------------------------------------
/packages/utils-worker/src/shims/file-type.ts:
--------------------------------------------------------------------------------
1 | export const fromBuffer = () => {
2 | return Promise.resolve(undefined);
3 | };
4 |
--------------------------------------------------------------------------------
/packages/utils-worker/src/shims/is-svg.ts:
--------------------------------------------------------------------------------
1 | export default function() {
2 | return false;
3 | }
4 |
--------------------------------------------------------------------------------
/packages/utils-worker/src/shims/request-async.ts:
--------------------------------------------------------------------------------
1 | export = { default: null };
2 |
--------------------------------------------------------------------------------
/packages/utils-worker/src/shims/url.ts:
--------------------------------------------------------------------------------
1 | export = {
2 | format: (url: URL) => {
3 | return `${url}`;
4 | },
5 | URL
6 | };
7 |
--------------------------------------------------------------------------------
/packages/utils/.gitignore:
--------------------------------------------------------------------------------
1 | db.json
2 |
--------------------------------------------------------------------------------
/packages/utils/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
2 |
--------------------------------------------------------------------------------
/packages/utils/.nycrc:
--------------------------------------------------------------------------------
1 | {
2 | "functions": 75
3 | }
4 |
--------------------------------------------------------------------------------
/packages/utils/scripts/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "allowJs": true,
4 | "alwaysStrict": true,
5 | "checkJs": true,
6 | "moduleResolution": "node",
7 | "noUnusedLocals": true,
8 | "resolveJsonModule": true,
9 | "strict": true,
10 | "target": "esnext"
11 | },
12 | "include": [
13 | "**/*.js"
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/packages/utils/src/@types/npm-registry-fetch.d.ts:
--------------------------------------------------------------------------------
1 | declare module 'npm-registry-fetch' {
2 | function json(url: string, opts?: any): Promise