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

svglint

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svglint - npm Package Compare versions

Comparing version 0.0.0-alpha.4 to 0.9.0-RC

.eslintrc.js

60

package.json
{
"name": "svglint",
"version": "0.0.0-alpha.4",
"description": "svglinter for js applications",
"main": "lib/svglint.js",
"files": [
"lib/",
"bin/"
],
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/fenderil/svglint.git"
},
"version": "0.9.0-RC",
"description": "Linter for SVGs",
"main": "src/svglint.js",
"bin": { "svglint": "./bin/cli.js" },
"keywords": [
"svg",
"svglint",
"svglint-config",
"svglint-plugin"
"vector",
"lint",
"linting",
"linter"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/fenderil/svglint/issues"
"author": "birjolaxew",
"license": "CC0",
"scripts": {
"lint": "eslint src/**/*.js test/**/*.js",
"test": "mocha"
},
"homepage": "https://github.com/fenderil/svglint#readme",
"dependencies": {
"chalk": "^2.3.0",
"commander": "^2.13.0",
"glob": "^7.1.2",
"jsdom": "^11.5.1",
"lodash": "^4.17.4"
"ansi-regex": "^3.0.0",
"chalk": "^2.4.1",
"cheerio": "^1.0.0-rc.2",
"htmlparser2": "^3.9.1",
"log-update": "^2.3.0",
"meow": "^3.7.0",
"strip-ansi": "^4.0.0"
},
"author": {
"name": "Tupitckiy Ilya",
"email": "fenderil@yandex.ru",
"url": "https://github.com/fenderil"
},
"bin": {
"svglint": "./bin/svglint.js"
},
"engines": {
"node": ">=6.1.0"
"devDependencies": {
"eslint": "^4.19.1",
"expect": "^1.20.2",
"mocha": "^5.2.0"
}
}

76

README.md

@@ -1,10 +0,68 @@

# svglint
svglinter for js applications
# SVGLint
TODOs:
* svglint.config - different file types
* svglint.config - extends config
* svglint.config - extends plugin
* --fix
* ...
* many else
Lints SVG files. Can be run as a commandline utility, or as a NodeJS library.
<p align="center"><img src="/example.png" alt="Example of a commandline execution"/></p>
## Usage
The tool can be used as a commandline tool by executing the CLI.
If installed as a dependency by NPM this will be found at `./node_modules/.bin/svglint`.
If installed globally by NPM it can be executed directly as `svglint`.
```
$ svglint --help
Linter for SVGs
Usage:
svglint [--config config.js] [--ci] [--debug] file1.svg file2.svg
Options:
--help Display this help text
--version Show the current SVGLint version
--config, -c Specify the config file. Defaults to '.svglintrc.js'
--debug, -d Show debug logs
--ci, -C Only output to stdout once, when linting is finished
```
The tool can also be used through the JS API.
```javascript
const SVGLint = require("svglint");
SVGLint.lintSource("<svg>...</svg>", {
// ... config goes here
});
```
## Config
In order to specify what should be linted SVGLint must be given a configuration object.
If you are using the CLI, this configuration object is read from the file specified by `--config`. This defaults to `.svglintrc.js`, which will be searched for up through the directory tree - this is similar to tools such as ESLint.
This configuration file should export a single object, of the format:
```javascript
module.exports = {
// additional configuration may go here in the future
// for now, "rules" is the only useful key
rules: {
elm: [{
// config 1 for the "elm" rule
}, {
// config 2 for the "elm" rule
}],
attr: {
// config 1 for the "attr" rule
},
custom: [
function() { // config 1 for the "custom" rule }
]
}
};
```
For specifics on how the config for each rule should be formatted, see [their specific rule files](/src/rules/).
If you are using the JS API, this configuration object is passed as the second parameter.
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