Commits (40)
{
"parser": "@typescript-eslint/parser",
"env": {
"node": true
},
"extends": [
"sidvind/es2017",
"plugin:@typescript-eslint/recommended",
"@html-validate",
"plugin:array-func/recommended",
"plugin:prettier/recommended",
"plugin:node/recommended-module",
"plugin:import/errors",
"plugin:import/warnings",
......@@ -18,68 +14,34 @@
"plugin:sonarjs/recommended"
],
"plugins": [
"@typescript-eslint",
"array-func",
"node",
"prettier",
"security",
"sonarjs"
],
"plugins": ["array-func", "node", "security", "sonarjs"],
"rules": {
"@typescript-eslint/array-type": "off",
"@typescript-eslint/explicit-function-return-type": [
"error",
{
"allowExpressions": true
}
],
"@typescript-eslint/explicit-member-accessibility": "error",
"@typescript-eslint/indent": "off",
"@typescript-eslint/member-delimiter-style": "error",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/triple-slash-reference": "error",
"@typescript-eslint/no-unused-vars": "warn",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/type-annotation-spacing": "error",
"consistent-this": "off",
"import/named": "off",
"no-console": "warn",
"no-dupe-class-members": "off",
"no-undef": "off",
"node/no-missing-import": "off",
"node/no-unsupported-features/es-syntax": "off",
"prettier/prettier": "warn",
"security/detect-non-literal-fs-filename": "off",
"security/detect-non-literal-require": "off",
"security/detect-object-injection": "off",
"security/detect-unsafe-regex": "off",
"strict": "off"
"security/detect-unsafe-regex": "off"
},
"overrides": [
{
"files": "*.spec.ts",
"env": {
"jest": true
},
"plugins": ["jest"],
"extends": ["plugin:jest/recommended", "plugin:jest/style"],
"files": "**/*.ts",
"extends": ["@html-validate/eslint-config/typescript"],
"rules": {
"jest/no-disabled-tests": "warn",
"jest/no-focused-tests": "warn",
"jest/no-test-prefixes": "warn",
"sonarjs/no-duplicate-string": "off",
"sonarjs/no-identical-functions": "off"
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-var-requires": "off"
}
},
{
"files": "*.js",
"files": "*.spec.[jt]s",
"extends": ["@html-validate/eslint-config/jest"],
"rules": {
"@typescript-eslint/explicit-function-return-type": "off"
"sonarjs/no-duplicate-string": "off",
"sonarjs/no-identical-functions": "off"
}
}
]
......
{
"tabWidth": 2,
"trailingComma": "es5",
"useTabs": true,
"overrides": [
{
"files": "docs/**/*.md",
"options": {
"useTabs": false
}
},
{
"files": "**/{*,.*}.json",
"options": {
"useTabs": false
}
}
]
}
# html-validate changelog
# [2.8.0](https://gitlab.com/html-validate/html-validate/compare/v2.7.0...v2.8.0) (2020-01-02)
### Features
- **rule:** validate matching case for start and end tags ([288cf86](https://gitlab.com/html-validate/html-validate/commit/288cf867dc6b1fdaf899cc695bb70b35c9a720a0))
- **rules:** refactor `parseStyle` from `element-case` and `attr-case` ([24d8fad](https://gitlab.com/html-validate/html-validate/commit/24d8fad19ba677502e1c19f8180efea44aa9cf34))
- **rules:** support multiple case styles ([5a397bd](https://gitlab.com/html-validate/html-validate/commit/5a397bd9aa281710f24925bec8dcc1bc29605403)), closes [#50](https://gitlab.com/html-validate/html-validate/issues/50)
- **rules:** support pascalcase and camelcase for `element-case` rule ([be7d692](https://gitlab.com/html-validate/html-validate/commit/be7d692838826a0de908d6cbb2867d02c43cee66))
# [2.7.0](https://gitlab.com/html-validate/html-validate/compare/v2.6.0...v2.7.0) (2019-12-16)
### Bug Fixes
......
@ngdoc content
@module about
@name About html-validate
@description
---
docType: content
title: About html-validate
---
# About
......
......@@ -90,3 +90,10 @@ footer {
.table-center {
text-align: center;
}
.alert .fa {
font-size: 1.3em;
margin-right: 0.5em;
position: relative;
top: 1px;
}
@ngdoc content
@module dev
@name Events
@description
---
docType: content
title: Events
---
# Events
......
@ngdoc content
@module usage
@name Developers guide
@description
---
docType: content
title: Developers guide
---
# Developers guide
......
@ngdoc content
@module dev
@name Transformers
@description
---
docType: content
title: Transformers
---
# Transformers
......
@ngdoc content
@module dev
@name Using API
@description
---
docType: content
title: Using API
---
# Using API
......
@ngdoc content
@module dev
@name Writing plugins
@description
---
docType: content
title: Writing plugins
---
# Writing plugins
......
@ngdoc content
@module dev
@name Writing rules
@description
---
docType: content
title: Writing rules
---
# Writing rules
......
const Package = require("dgeni").Package;
const pkg = new Package("dgeni-bootstrap", []);
pkg.config(function(inlineTagProcessor, getInjectables) {
const inlineTagsDefs = getInjectables(require("./inline-tag-defs"));
inlineTagProcessor.inlineTagDefinitions = inlineTagProcessor.inlineTagDefinitions.concat(
inlineTagsDefs
);
});
module.exports = pkg;
module.exports = function alertDangerInlineTagDef() {
return {
name: "alert-danger",
description: "Add bootstrap danger alert",
handler: function(doc, tagName, tagDescription) {
return `<div class="alert alert-danger"><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> ${tagDescription}</div>`;
},
};
};
module.exports = function alertInfoInlineTagDef() {
return {
name: "alert-info",
description: "Add bootstrap info alert",
handler: function(doc, tagName, tagDescription) {
return `<div class="alert alert-info"><i class="fa fa-info-circle" aria-hidden="true"></i> ${tagDescription}</div>`;
},
};
};
module.exports = function alertSucccessInlineTagDef() {
return {
name: "alert-success",
description: "Add bootstrap success alert",
handler: function(doc, tagName, tagDescription) {
return `<div class="alert alert-success"><i class="fa fa-check" aria-hidden="true"></i> ${tagDescription}</div>`;
},
};
};
module.exports = function alertWarningInlineTagDef() {
return {
name: "alert-warning",
description: "Add bootstrap warning alert",
handler: function(doc, tagName, tagDescription) {
return `<div class="alert alert-warning"><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> ${tagDescription}</div>`;
},
};
};
module.exports = [
require("./alert-success"),
require("./alert-info"),
require("./alert-warning"),
require("./alert-danger"),
];
const preamble = `
@ngdoc changelog
@module usage
@name Changelog
@description
`;
function fixHeading(src) {
return src.replace(/^# html-validate changelog/, "# Changelog");
}
function dropUpcoming(src) {
return src.replace(/^## Upcoming release$[^]*?^(?=## )/m, "");
}
function prepare(src) {
src = fixHeading(src);
src = dropUpcoming(src);
return preamble + src;
return fixHeading(src);
}
module.exports = function changelogFileReader() {
......@@ -26,6 +12,8 @@ module.exports = function changelogFileReader() {
getDocs: function(fileInfo) {
return [
{
docType: "changelog",
title: "Changelog",
content: prepare(fileInfo.content),
startingLine: 1,
},
......
......@@ -3,8 +3,8 @@ const Package = require("dgeni").Package;
const packagePath = __dirname;
module.exports = new Package("html-validate-docs", [
require("dgeni-packages/ngdoc"),
require("dgeni-packages/nunjucks"),
require("dgeni-front-matter"),
require("./bootstrap"),
require("./highlight"),
require("./inline-validate"),
require("./schema"),
......@@ -17,17 +17,6 @@ module.exports = new Package("html-validate-docs", [
renderDocsProcessor.extraData.tracking = process.env.GA_TRACKING_ID;
})
/* disable unused module generation */
.config(function(
moduleDocsProcessor,
generateComponentGroupsProcessor,
collectKnownIssuesProcessor
) {
moduleDocsProcessor.$enabled = false;
generateComponentGroupsProcessor.$enabled = false;
collectKnownIssuesProcessor.$enabled = false;
})
/* configure markdown syntax highlighting */
.config(function(highlight) {
highlight.configure({
......@@ -41,21 +30,16 @@ module.exports = new Package("html-validate-docs", [
readFilesProcessor.fileReaders.push(changelogFileReader);
})
.config(function(
log,
readFilesProcessor,
templateFinder,
writeFilesProcessor,
copySchema
) {
.config(function(log, readFilesProcessor, writeFilesProcessor, copySchema) {
log.level = "info";
readFilesProcessor.basePath = path.resolve(packagePath, "../..");
readFilesProcessor.sourceFiles = [
{
include: "docs/**/*.md",
exclude: "docs/dgeni/**/*.md",
basePath: "docs",
fileReader: "ngdocFileReader",
fileReader: "frontMatterFileReader",
},
{
include: "CHANGELOG.md",
......@@ -110,7 +94,12 @@ module.exports = new Package("html-validate-docs", [
}
},
getAliases: function(doc) {
return [doc.id, doc.name, `${doc.docType}:${doc.name}`];
const alias = [doc.id];
if (doc.name) {
alias.push(doc.name);
alias.push(`${doc.docType}:${doc.name}`);
}
return alias;
},
});
......
# Inline HTML-validate results
Processes the markup inside the tag and runs HTML-Validate on it.
If there are any errors they will be printed using `codeframe` formatter.
Jest snapshot tests will also be generated for each validation to ensure changes to documentation validations will be consistent with intended changes.
```html
<validate name="document-unique-name">
<!-- my markup -->
</validate>
```
## Usage
The following attributes can be set:
- `name` - a per-document unique name.
- `rules` - a whitespace-separated list of rules to enable. Default: all rules from recommended list
- `elements` - path to custom metadata (relative to current file). Default: `html5`
- `results` - set to `true` to force validation results to show up even if it is 0. Default `auto`.
Rule options can be set by using the rule name as attribute and providing a JSON-encoded string with options.