Rules should have access to source
blocks github:YPetremann/html-validate-prettier#1
Rules doesn't have access to source. If the source came from a file, they can read the file, but they can"t get the source from string validation.
Use cases
html-validate-prettier is a direct equivalent to eslint-plugin-prettier and stylelint-prettier for html-validate
It needs to run prettier as a rule in html-validate and so need to access the source of the string or file validated. Other plugins could really benefit access to the source.
Solutions
Either way:
- an event 'source:ready' with a SourceReadyEvent containing
- source: string the source
-
location: Location of the source, this is important to have it for the context
- whole document: {filename: ??, size: ??, offset:0, line:1, column:1}
- partial document: {filename: ??, size: ??, offset: ??, line: ??, column: ??}
- whole stream: {filename: null, size: ??, offset: 0, line: 1, column: 1}
- add a source property to DOMReadyEvent.
Edited by Y.Petremann