Socket
Socket
Sign inDemoInstall

@next/eslint-plugin-next

Package Overview
Dependencies
Maintainers
8
Versions
1974
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@next/eslint-plugin-next - npm Package Compare versions

Comparing version 9.4.2 to 9.4.3-canary.0

2

lib/index.js

@@ -5,2 +5,3 @@ module.exports = {

'no-sync-scripts': require('./rules/no-sync-scripts'),
'no-html-link-for-pages': require('./rules/no-html-link-for-pages'),
},

@@ -12,2 +13,3 @@ configs: {

'@next/next/no-sync-scripts': 1,
'@next/next/no-html-link-for-pages': 1,
},

@@ -14,0 +16,0 @@ },

@@ -39,3 +39,5 @@ const path = require('path')

const href = node.attributes.find((attr) => attr.name.name === 'href')
const href = node.attributes.find(
(attr) => attr.type === 'JSXAttribute' && attr.name.name === 'href'
)

@@ -47,2 +49,7 @@ if (!href || href.value.type !== 'Literal') {

const hrefPath = normalizeURL(href.value.value)
// Outgoing links are ignored
if (/^(https?:\/\/|\/\/)/.test(hrefPath)) {
return
}
urls.forEach((url) => {

@@ -49,0 +56,0 @@ if (url.test(normalizeURL(hrefPath))) {

@@ -27,3 +27,4 @@ const fs = require('fs')

return parseUrlForPages(urlPrefix, directory).map(
(url) => new RegExp(normalizeURL(url))
// Since the URLs are normalized we add `^` and `$` to the RegExp to make sure they match exactly.
(url) => new RegExp(`^${normalizeURL(url)}$`)
)

@@ -71,2 +72,6 @@ }

url = url = url.replace(/(\/index\.html)$/, '/')
// empty URLs should not be trailed with `/`, e.g. `#heading`
if (url === '') {
return url
}
url = url.endsWith('/') ? url : url + '/'

@@ -73,0 +78,0 @@ return url

4

package.json
{
"name": "@next/eslint-plugin-next",
"version": "9.4.2",
"version": "9.4.3-canary.0",
"description": "ESLint plugin for NextJS.",

@@ -11,3 +11,3 @@ "main": "lib/index.js",

},
"gitHead": "91b1548d3296dae4306ad68b97fd61d092c06ebe"
"gitHead": "89bc74909ba0cb34e113b617947f5338fec755cb"
}
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