Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
access-sniff-ext
Advanced tools
A CLI, JsDom and PhantomJs library for HTML_CodeSniffer
This fork writes the report, even if errors are detected in input files.
Install this plugin with npm install access-sniff-ext --save
var AccessSniff = require('access-sniff-ext');
AccessSniff
.default(['**/*.html'], options)
.then(function(report) {
AccessSniff.report(report, reportOptions);
});
import AccessSniff, { reports as AccessReports } from 'access-sniff-ext';
AccessSniff(['**/*.html'], options)
.then(report => AccessReports(report, reportOptions));
npm install access-sniff-ext -g
sniff test/**/*.html -r json -l reports
AccessSniff can test both locally hosted files and websites.
sniff http://statamic.com/ -r json -l reports
You can pass the following options
accessibilityLevel
is a string
options: {
accessibilityLevel: 'WCAG2A'
}
Levels are WCAG2A
, WCAG2AA
, WCAG2AAA
, and Section508
You can create an .accessibilityrc file in your project to set options:
{
"ignore": [
"WCAG2A.Principle2.Guideline2_4.2_4_2.H25.1.NoTitleEl",
"WCAG2A.Principle3.Guideline3_1.3_1_1.H57.2"
]
}
ignore
is an array
You can ignore rules by placing them in an array outlined below.
options: {
ignore: [
'WCAG2A.Principle2.Guideline2_4.2_4_2.H25.1.NoTitleEl'
'WCAG2A.Principle3.Guideline3_1.3_1_1.H57.2'
]
}
Rules will also match to remove and entire set.
WCAG2A.Principle2.Guideline2_4.2_4_2.H25.1
will ignore WCAG2A.Principle2.Guideline2_4.2_4_2.H25.1.NoTitleEl
ignoreByDescription
, ignoreByElement
, ignoreByClass
and ignoreById
are arrays
You can ignore rules by including their description, element content, CSS class or HTML ID in their full as string, or by including regular expression matching their textual value. This can be useful to ignore only some problem occurrences, which are "false positives", while retaining the other checks done by the same rule.
options: {
ignoreByDescription: [
'This form field should be labelled in some way. Use the label element ' +
'(either with a "for" attribute or wrapped around the form field), or ' +
'"title", "aria-label" or "aria-labelledby" attributes as appropriate.',
/^This element has a role of "\w+" but does not have a name available to an accessibility API\. Valid names are: [^.]+\.$/
],
ignoreByElement: [
/^<a id="herpDerp" class="[^"]*" href="test">Test<\/a>$/
],
ignoreByClass: [
/\bcustom-checkbox\b/
],
ignoreById: [
'select-all'
]
}
errorLevels
is an object
options: {
errorLevels: {
notice: false,
warning: false,
error: true
}
}
If an issue of a certain level is found and this level is flagged by true
in errorLevels
, validation will fail
verbose
is a boolean
options: {
verbose: false
}
Output messages to console, set to true by default
force
is a boolean, defaults to false
options: {
force: true
}
Continue running in the event of failures. You can catch failures from the promise as below:
AccessSniff(['**/*.html'], options)
.then(report => AccessReports(report, reportOptions));
.catch(error => console.error(error))
browser
is a boolean, defaults to false
options: {
browser: false
}
AccessSniff uses jsDom as the default, setting this to true will use PhantomJs instead
maxBuffer
is a number, defaults to 500*1024
In certain situations you might have to increase the memory allocated to render a page.
options: {
maxBuffer: 500*1024
}
You can pass the following options to the report generator
You can use the inbuilt system or create your own
AccessSniff.report(report, reportOptions)
reportType
is a string
options: {
reportType: 'json'
}
Text, CSV or JSON format output
txt
will output text filesjson
will output .json filescsv
will output csvreportLocation
is a string
options: {
reportLocation: 'reports'
}
Set the value to where you want reports created
reportLevels
is an object
options: {
reportLevels: {
notice: true,
warning: true,
error: true
}
}
Set a value to false
to limit output
You can use the CLI component by installing it globally with npm install -g access-sniff-ext
sniff test/**/*.html -r json -l reports
sniff test/**/*.html -r csv -l reports
sniff test/**/*.html -r txt -l reports
-e
or -errorLevels
Combination of comma-delimited error, warning and notice.
-r
or -reportType
txt, csv, json.
-r
or -reportLocation
-f
or -force
-q
or -quiet
FAQs
A node/iojs library & CLI for HTML_Codesniffer
The npm package access-sniff-ext receives a total of 0 weekly downloads. As such, access-sniff-ext popularity was classified as not popular.
We found that access-sniff-ext 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.