New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@linthtml/linthtml

Package Overview
Dependencies
Maintainers
1
Versions
97
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@linthtml/linthtml - npm Package Versions

1
10

0.5.1

Diff

Changelog

Source

v0.5.1

Fix 🛠️

  • Generate JSON config file with correct json object inside.
  • Use Object.defineProperty to add attributes property to AST node and fix a runtime error.
kamikillerto
published 0.5.0 •

Changelog

Source

v0.5.0

Features 🚀

New rule

Add the rule no-surrounding-whitespace disallowing the presence of encapsulating whitespace. For example the following code will report an error:

<p>A simple text with whitespaces before</p>

You can find more informations in the rule doc.

Improve config file search

Now, for each file linted, LintHTML will look for a config file in the file local folder. If a config file is found, LintHTML will use it. If there's no config file LintHTML will check each parent folder and stop once it finds a config file or reaches the HOME folder.

Print error for invalid rule config

LintHTML will now report an error if a rule is not correctly activated in the new config format. For example, the following patterns will now print errors in the console.

// Valid string values are "error", "warning" and "off"
"rule-name": "foo"

// Only string, boolean and array are accepted
"rule-name": 1
"rule-name": {}

// If an array is provided, the first value should be a valid string or a boolean
"rule-name": [1, rule_config]
"rule-name": ["foo", rule_config]
"rule-name": [{}]

Breaking change ⚠️ (old config)

Remove the possibility to use presets in inline config. This feature was not documented in LintHTML and not available when using the new config format.

Improvements 🔧

HTML parser improvments

Upgrade htmlparser2 and improve outputed AST to extract more informations about nodes, for example now a node element:

  • contains all attributes event the duclicated and know the start and end location for each.
  • has more informations about open/close tags

All nodes now include a property loc containing start and end position (line/column).

Thanks to the AST improvements somme rules have been updated to better target the errors locations.

Refactor 🧰

Config validations utils function

Create some utils functions to check rules config and have unified error messages.

kamikillerto
published 0.5.0-beta.4 •

Changelog

Source

v0.5.0-beta.4

Features 🚀

Added new rule no-surrounding-whitespace disallowing the presence of encapsulating whitespace, see rule doc.

kamikillerto
published 0.5.0-beta.3 •

Changelog

Source

v0.5.0-beta.3

Features 🚀

Improve config file search

Now, for each file linted, LintHTML will look for a config file in the file local folder. If there's a config file LintHTML will use it, if there's no config file LintHTML will check each parent and stop once it find a config file or reach the HOME folder.

Refactor 🧰

Config validations utils function

Create some utils functions to check rules config and have unified error messages.

kamikillerto
published 0.5.0-beta.2 •

Changelog

Source

v0.5.0-beta.2

Improvements 🔧

Improve issues locations for a bunch rules.

Internal

Get rig of the peudo rules line to only use the AST tree in all rules.

kamikillerto
published 0.4.2 •

Changelog

Source

v0.4.2

Features 🚀

Rule lang now support simplified Chinese and traditional Chinese.

Use the following codes in your linthtmlrc file.

  • zh-cmn-Hans: simplified Chinese
  • zh-cmn-Hant: traditional Chinese
kamikillerto
published 0.5.0-beta.1 •

Changelog

Source

v0.5.0-beta.1

Features 🚀

Upgrade htmlparser2 and improve outputed AST. Now a node element:

  • contains duplicated attributes and has the start and end location for each.
  • has more informations about open/close tags

All nodes now include a property loc containing start and end position (line/column).

kamikillerto
published 0.4.1 •

Changelog

Source

v0.4.1

Fix 🛠️

Correct classes extractions to avoid reporting class-style errors for empty class.

kamikillerto
published 0.4.0 •

Changelog

Source

v0.4.0

Features 🚀

[CLI] Improved init command

Give the possiblity to select the output format between JS, JSON and YAML. It's also possible to generate a config file in the legacy format (like HTMLLint) or in the new format (introduced in the v0.3.0).

Inline config with new config

Inline configs are now working with the new config format introduced in the v0.3.0. Inline config can be used to change a rule config or enable/disable a rule, see the documentation for more informations about inline config usages.

Ignore files

It's now possible to specify a list of list files to ignore using .linthtmlignore file or ignoreFiles property in the config file (Documentation page).

Improvements 🔧

  • Change focusable-tabindex-style rule behavior, now this rules report errors if a node has a tabindex greater than 0. frame tag are now listed as self closing elements.
  • Improve error message for rules indent-size and indent-style.

Fix 🛠️

  • The rule id-class-style is now correctly called when id-style or class-style are not activated.
  • tag-bans is now case insensitive, when config is only a single string (same behavior as array config)
  • Correctly extract config that are just numbers.
kamikillerto
published 0.4.0-beta.4 •

Changelog

Source

v0.4.0-beta.4

Feature 🚀

Inline config now work with the new config format.

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc