Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
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.
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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.