Rewrite configuration structure
Open
@Shinigami92 is already working on this.
Since May 16, 2020.
feature request
keep-unstale
- Dominant language
- JavaScript
- Stars
- 3.3k
- Forks
- 474
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 12
Description
Is your feature request related to a problem? Please describe.
Today's tools are characterized by a much better style of configuration file
It's much more extensible and supports things like defaultSeverity and presets that load before its own configuration
Describe the solution you'd like
We will rewrite the configuration in eslint-style, see https://github.com/htmlhint/HTMLHint/issues/279#issuecomment-417939741
TODOs
- rewrite rules (#445 merged)
- update docu (#447 merged)
- move rules into attribute
"rules": { /* ... */ }(#476 merged) - parse inline rules with options (extracted to #503)
- add attribute
"extends"(#489 in review)- define value
"htmlhint:recommended"
- define value
- add attribute
"defaultSeverity"(is this still needed? 🤔)
this could be done after release 1.0.0 - add attribute
"exclude"(extracted to #502)
this could be done after release 1.0.0
Old proposal
We should rewrite the configuration file into something like this:
{
"extends": ["htmlhint:recommended"],
"defaultSeverity": "error",
"htmlVersion": "html5",
"rules": {
"attr-no-duplication": true,
"attr-unsafe-chars": true,
"attr-value-double-quotes": true,
"doctype-first": false,
"doctype-html5": true,
"id-class-ad-disabled": true,
"id-class-value": ["dash", { "severity": "warning" }],
"id-unique": true,
"inline-style-disabled": false,
"space-tab-mixed-disabled": ["tab", { "severity": "warning" }],
"spec-char-escape": true,
"src-not-empty": true,
"style-disabled": [true, { "severity": "warning" }],
"tag-pair": true,
"tag-self-close": false,
"tagname-lowercase": [
true,
{
"exceptions": ["linearGradient"]
}
],
"title-require": true,
"stylelint": [
true,
{
"extends": "stylelint-config-standard",
"rules": {
"block-no-empty": null,
"color-no-invalid-hex": true
}
}
],
"eslint": [
true,
{
"configFile": "./.eslintrc.json"
}
]
},
"exclude": ["test/**/*.html"]
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.