
Security News
npm ‘is’ Package Hijacked in Expanding Supply Chain Attack
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
postcss-add-block-lint
Advanced tools
A PostCSS plugin that is used to lint css for existence of classes that might trigger add blockers.
IMPORTANT: This project is no longer maintained.
A PostCSS plugin that is used to lint css for existence of classes that might trigger add blockers.
These instructions are only for this plugin. See the PostCSS website for framework information.
Using Yarn
yarn add postcss-add-block-lint --exact --dev
Using NPM
npm install postcss-add-block-lint --save-dev --save-exact
Add to your PostCSS configuration.
const Gulp = require("gulp");
const PostCSS = require("gulp-postcss");
const AddBlockLint = require("postcss-add-block-lint");
Gulp.task("css", () =>
Gulp.src("./src/*.css").pipe(
PostCSS([
AddBlockLint({
rules: [
`${__dirname}/data/easylist.txt`,
`${__dirname}/data/easylist-cookie.txt`,
`${__dirname}/data/fanboy-social.txt`,
`${__dirname}/data/fanboy-annoyance.txt`,
],
}),
])
)
);
const AddBlockLint = require("postcss-add-block-lint");
module.exports = {
module: {
rules: [
{
test: /\.css$/,
use: [
"style-loader",
{ loader: "css-loader", options: { importLoaders: 1 } },
{
loader: "postcss-loader",
options: {
plugins: [
AddBlockLint({
rules: [
`${__dirname}/data/easylist.txt`,
`${__dirname}/data/easylist-cookie.txt`,
`${__dirname}/data/fanboy-social.txt`,
`${__dirname}/data/fanboy-annoyance.txt`,
],
}),
],
},
},
],
},
],
},
};
Based on example from https://webpack.js.org/loaders/postcss-loader/.
Ensure that ad blocking lists are downloaded to ./data
directory.
yarn prepare
When matches are found, they will be outputted to the console.
The minimal required configuration is the rules
list, as shown in the above example.
AddBlockLint({
rules: [
`${__dirname}/data/easylist.txt`,
`${__dirname}/data/easylist-cookie.txt`,
`${__dirname}/data/fanboy-social.txt`,
`${__dirname}/data/fanboy-annoyance.txt`,
],
});
Lists shown in the above example can be accessed from the following locations:
FAQs
A PostCSS plugin that is used to lint css for existence of classes that might trigger add blockers.
The npm package postcss-add-block-lint receives a total of 8 weekly downloads. As such, postcss-add-block-lint popularity was classified as not popular.
We found that postcss-add-block-lint demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
Security News
A critical flaw in the popular npm form-data package could allow HTTP parameter pollution, affecting millions of projects until patched versions are adopted.
Security News
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.