This is an ESLint plugin with rules that help validate proper URLs.
Install eslint-plugin-url
npm install --save-dev eslint-plugin-url
In .eslintrc
{
"plugins": [
"url"
],
"rules": {
// add rules here
}
}
Or
{
"extends": [
"plugin:url/recommended"
],
"rules": {
// override/add rules here
}
}
Rule ID | Description | Recommended | fixable |
---|---|---|---|
no-absolute-url | disallow the use of absolute URLs | error | yes |
no-http | disallow the use of HTTP in hyperlinks | off | yes |