-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy path.todo
More file actions
110 lines (90 loc) · 5.54 KB
/
Copy path.todo
File metadata and controls
110 lines (90 loc) · 5.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
## cli
- allow absolute path "linthtml /root/xx/xx/my.html"
- allow realtive path with ".." "linthtml ../my.html"
## refactor
- [x] [0.5.0][inline-config] Remove `preset=`, `${preset}`
- [ ] [0.5.0][inline-config] Remove `$previous`
- [x] [0.5.0] Remove pseudo `line` rule
- [x] [0.5.0?] Activate rule using string "on"
- [ ] [0.5.0] Improve inline_config extraction
- (rule1 rule2=config) (extract rule1 and rule2)
- (rule1= rule2=config) (extract rule1 and rule2)
- (rule1=config rule1) (extract rule1 and rule2)
Use parser ?
- [ ] add a rule to enforce href on links
- [x] rename rule `link-min-length-4` in `link-min-length` and add a length option
- [ ] `raw-ignore-text` Find a better solution than the current one
- [ ] Get rid of the process function in rules. Config send to rules should be the same as the one defined in the config file
This function should be changed for a validation function that raise errors if config is not valid
- [x] No rules by default
- [ ] Tests should assert issues too (code, position...)
- [x] move rules tests in the rule folder
## New rules
- [ ] no-script-head -> Forbid the use of `script` tag in the head tag
- [ ] no-style-tag -> Forbid the use of `style` tag
- [ ] no-inline-javascript -> Forbid the use of JS code inside a tag attribute
- [x] no-inline-style -> forbid the use `style` attribute on tag
- [ ] no-deprecated-lang ? -> Use https://www.npmjs.com/package/language-tags to lint deprecated value for lang attribute
## deprecate rules
- [ ] input-radio-req-name can be merged with input-req-name (don't exist yet)
- [x] indent-delta don't understand this rule
- [x] raw-ignore-regex it's no really a rule (maybe a options for the linter, but i'm not sure we should keep this option)
- [ ] maxerr convert in max maxWarn instead ?
- [x] id-class-style
- [ ] attr-new-line: Get rid of "0+"
## Fix rules naming convention
- complete mane :
- req => require
- len => length
- dup => duplicate
## Correct rules
- [ ] `raw-ignore-regex` tests are not really testing anything
- [ ] `button-req-content` should check for aria-labelledby too
- [ ] Rename `input-btn-req-value-or-title` (message from axe "Input buttons must have discernible text")
- [x] Merge `attr-name-style` and `attr-name-ignore-regex` (this one should be an option of the first)
- [x] `attr-req-value` should report an error for empty values (`''` or `""`). Can be an option like `strict`
- [ ] `attr-req-value` should permit to allowlist attributes that can have no value (default should be boolean attributes like `disable`)
- [ ] `attr-validate` should not accept `\b` `\t` in attributes's value
- [ ] `class-style` get rid of `bem` format ? Tests seems not valid and it's hard to tel what's BEM or not
- [ ] merge `doctype-first` and `doctype-html5` (html5 should be an option (should be be default too ?))
- [ ] `doctype-first` `smart` should be an option. `smart` should not report if doctype + html + head not present ?
- [ ] `doctype-first` should return an error if first element is plain text (plain text is in fact a textNode)
- [ ] `fig-req-figcaption` report error when figcaption is empty
- [ ] `focusable-tab-index-style` rename the rule
- [x] `id-class-no-ad` deprecate this one ? Why not allow `ad`, `social`... in id or class ? (Can be replaced by a rule that ban word in attributes (using a regexp))
- [ ] `attr-new-line` value of 0 should not allow one attribute per line. Config should only accept >=1 ?
- [ ] `attr-new-line` limit value should only be used for line with tag, other lines should not contains more than 1 attr
- [ ] `lang-style` use https://www.npmjs.com/package/language-tags to get latest tags list
- [ ] `line-end-style` Remove options "windows" and "unix"
## Improve inline config
- [x] The `preset` thing is totally overkill, hard to understand >< and not documented very well.
- [ ] The `$previous` thing is totally overkill and hard to understand >< , Maybe we can keep this one).
- [x] Add `.linthtml-disable ?[rules]` and `.linthtml-enable ?[rules]`
- [x] `linthtml-configure` should accept only one rule, something like `linthtml-configure [rule] [value]`
## Coming "soon"
- [ ] Tests for the `cli`.
- [ ] Nice/cute logo (because every projects should have one)
- [ ] A website + online documentation to make it easier for everyone to use LintHTML. (The website will be accessible and available in as many language as possible)
- [ ] Translated `cli`. Like the website the `cli` should be available in as many language as possible
- [✔️] Improved config file. The current config file format is not good and should be improved. (Should definitively looks like [eslint](https://eslint.org), [stylelint](http://stylelint.io/), [tslint](https://palantir.github.io/tslint/)...) (planned for the version 0.3.0)
- [ ] Rules naming guideline (like the one from [stylelint](https://stylelint.io/user-guide/about-rules/))
- [✔️] Warning level for rules.
- [x] Plugins (there's already a plugins system inherited from HtmlLint but it's not documented and tested so 🤫)
- [ ] Man pages for the cli ? (https://docs.npmjs.com/cli/v7/configuring-npm/package-json#directoriesman)
## inline config
`linthtml-enable, linthtml-disable, linthtml-configure` cannot be use to activate new rules
only affect configured rules (already defined before)
<div>
<div>
foo // not ignored
{{!-- linthtml-disable rule=config --}}
<div>
foo // ignored
</div>
foo // ignored
</div>
foo // not ignored
</div>
## Fix file coverage
Current files coverage is not complete has coverage on depend projects is not generated.
Check it works after nx migration