parse5
parse5 copied to clipboard
build improvement: enable explicit-member-accessibility ESLint rule
We should set @typescript-eslint/explicit-member-accessibility to error.
This will require that all members now have accessibility modifiers (e.g. public).
Should be an easy one, though it will probably uncover a lot of places we are misusing protected methods as if they were public (where protected ones right now are prefixed with _).
The big issue here is the parser, which uses a lot of internal methods, which are used by functions called by the parser (eg. startTagInCell). I am unsure of the best way forward here; one option is to just add all of these functions as methods to the parser.
yup, its just poorly structured right now.
many of the parser's methods are prefixed with _ as if they are protected/private, but that is a lie because countless functions which consume a parser access those methods from outside.
with the current structure i'd just make the methods public that are accessed from those functions, as thats what they really are, whether we like it or not.
longer term i'd prefer seeing those functions become part of the parser like you say. though that'd result in a crazily huge parser class, so thats another problem we should solve too: extracting much of the logic into utilities/helpers/other new classes.