Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
@woltapp/stylelint-plugin-browserbug
Advanced tools
Document, and eventually remove, browser bug workarounds
@woltapp/stylelint-plugin-browserbug
Lint rules for documenting, and eventually removing, browser bug workarounds.
TODO: Ensure you have node and nvm. Ensure you have the package token.
You'll first need to install Stylelint:
npm i stylelint --save-dev
npm i @woltapp/stylelint-plugin-browserbug --save-dev
Add browserbug
to the plugins section of your
stylelint configuration file.
{
"plugins": ["@woltapp/stylelint-plugin-browserbug"],
"rules": {
"@woltapp/browserbug-comment-no-outdated": true
}
}
Note: for the rules to practically work, you must also specify a
browserslist config. Any of the supported browserslist
methods would work, for example a browserslist
entry in package.json
.
The plugin works via code comments.
Comments are prefixed as @browserbug
, and include a list of descriptors.
Descriptors can be comma separated. A comment can follow the list of
descriptors, starting with --
.
/* The no-outdated rule will report an error if the specified range is no longer supported. */
/* @browserbug safari lower-than-or-equal 15.4 -- Some comment here */
/* @browserbug safari lte 15.4 */
/* @browserbug safari lower-than 16.0 */
/* @browserbug safari lt 16.0 */
/* @browserbug chrome equal 117 */
/* @browserbug chrome between 117 120 -- Inclusive range */
/* These descriptors are equivalent to 'equal' and 'between' for the purposes of no-outdated. Additionally, the last-checked-updated rule will report an error if there is a newer version of the specified versions available. */
/* @browserbug chrome last-checked 121 */
/* @browserbug chrome last-checked-between 117 121 -- Same as last-checked, but documents when a workaround started */
💼 Configurations enabled in.
✅ Set in the recommended
configuration.
Name | Description | 💼 |
---|---|---|
no-outdated | Ensures that no browserbug comment exists, if browserslist support for that browser is outside the specified range. | ✅ |
At the moment, the package is not published on any registry. Thus, you must clone the repo and link the package on your machine. This is also useful if you are contributing to the development, and want to test with a real codebase.
(The following is adapted from typescript-eslint's excellent guide on local linking)
The general strategy is:
@woltapp/stylelint-plugin-browserbug
packages available
as a global symlink.To make @woltapp/stylelint-plugin-browserbug
available globally, run the link
command from the package root (i.e. packages/stylelint-plugin-browserbug
).
The command depends on your package manager:
npm link
pnpm link --global
yarn link
Now that the package is available locally, you can link to it in the local downstream repository.
Run that repository's package manager's link command:
npm link @woltapp/stylelint-plugin-browserbug
pnpm link --global @woltapp/stylelint-plugin-browserbug
yarn link @woltapp/stylelint-plugin-browserbug
yarn link /path/to/your/browserbug/packages/stylelint-plugin-browserbug
resolutions
entry for each package in the local downstream
repository's package.json
Now, you should be able to run stylelint in the local downstream repository as
you normally would, and have it reference the local
@woltapp/stylelint-plugin-browserbug
package.
FAQs
Document, and eventually remove, browser bug workarounds
The npm package @woltapp/stylelint-plugin-browserbug receives a total of 0 weekly downloads. As such, @woltapp/stylelint-plugin-browserbug popularity was classified as not popular.
We found that @woltapp/stylelint-plugin-browserbug demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.