Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New: Allow hint metadata to be imported separately
Extracts existing `HintMetadata` objects into dedicated files and adds a new `name` field to the `docs` property. Allows hint metadata to be imported and bundled separately from the implementation of a hint, reducing bundle size for documentation scenarios. Also updates all hint names for consistency both in the new metadata and in the title of each associated `README`.
- Loading branch information
Showing
151 changed files
with
1,318 additions
and
902 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Category } from 'hint/dist/src/lib/enums/category'; | ||
import { HintScope } from 'hint/dist/src/lib/enums/hintscope'; | ||
import { HintMetadata } from 'hint/dist/src/lib/types'; | ||
|
||
const meta: HintMetadata = { | ||
docs: { | ||
category: Category.performance, | ||
description: `Require HTML page to be AMP valid.`, | ||
name: 'AMP HTML validator' | ||
}, | ||
id: 'amp-validator', | ||
schema: [{ | ||
additionalProperties: false, | ||
properties: { 'errors-only': { type: 'boolean' } }, | ||
type: 'object' | ||
}], | ||
scope: HintScope.any | ||
}; | ||
|
||
export default meta; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { Category } from 'hint/dist/src/lib/enums/category'; | ||
import { HintScope } from 'hint/dist/src/lib/enums/hintscope'; | ||
import { HintMetadata } from 'hint/dist/src/lib/types'; | ||
|
||
const meta: HintMetadata = { | ||
docs: { | ||
category: Category.pwa, | ||
description: `Require an 'apple-touch-icon'`, | ||
name: 'Use Apple touch icon' | ||
}, | ||
id: 'apple-touch-icons', | ||
schema: [], | ||
scope: HintScope.any | ||
}; | ||
|
||
export default meta; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { Category } from 'hint/dist/src/lib/enums/category'; | ||
import { HintScope } from 'hint/dist/src/lib/enums/hintscope'; | ||
import { HintMetadata } from 'hint/dist/src/lib/types'; | ||
|
||
const meta: HintMetadata = { | ||
docs: { | ||
category: Category.accessibility, | ||
description: 'Runs axe-core tests in the target', | ||
name: 'aXe accessibility check' | ||
}, | ||
id: 'axe', | ||
schema: [{ | ||
additionalProperties: false, | ||
properties: { | ||
rules: { | ||
patternProperties: { | ||
'^.+$': { | ||
additionalProperties: false, | ||
properties: { enabled: { type: 'boolean' } }, | ||
required: ['enabled'], | ||
type: 'object' | ||
} | ||
}, | ||
type: 'object' | ||
}, | ||
runOnly: { | ||
additionalProperties: false, | ||
properties: { | ||
type: { type: 'string' }, | ||
values: { | ||
items: { type: 'string' }, | ||
minItems: 1, | ||
type: 'array', | ||
uniqueItems: true | ||
} | ||
}, | ||
type: 'object' | ||
} | ||
} | ||
}], | ||
/* | ||
* axe can not analize a file itself, it needs a connector. | ||
*/ | ||
scope: HintScope.any | ||
}; | ||
|
||
export default meta; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Babel configuration is valid (`is-valid`) | ||
# Valid Babel configuration (`is-valid`) | ||
|
||
## Why is this important? | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/** | ||
* @fileoverview Verify that the babel config is valid. | ||
*/ | ||
|
||
module.exports = { 'is-valid': require('./meta/is-valid') }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { Category } from 'hint/dist/src/lib/enums/category'; | ||
import { HintScope } from 'hint/dist/src/lib/enums/hintscope'; | ||
import { HintMetadata } from 'hint/dist/src/lib/types'; | ||
|
||
const meta: HintMetadata = { | ||
docs: { | ||
category: Category.development, | ||
description: `'babel-config/is-valid' warns against providing an invalid babel configuration file \`.babelrc\``, | ||
name: 'Valid Babel configuration' | ||
}, | ||
id: 'babel-config/is-valid', | ||
schema: [], | ||
scope: HintScope.local | ||
}; | ||
|
||
export default meta; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Category } from 'hint/dist/src/lib/enums/category'; | ||
import { HintScope } from 'hint/dist/src/lib/enums/hintscope'; | ||
import { HintMetadata } from 'hint/dist/src/lib/types'; | ||
|
||
const meta: HintMetadata = { | ||
docs: { | ||
category: Category.interoperability, | ||
description: 'Require `Content-Type` header with appropriate value', | ||
name: 'Correct `Content-Type` header' | ||
}, | ||
id: 'content-type', | ||
schema: [{ | ||
items: { type: 'string' }, | ||
type: ['object', 'null'], | ||
uniqueItems: true | ||
}], | ||
scope: HintScope.site | ||
}; | ||
|
||
export default meta; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.