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

eslint-plugin-annotation

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-annotation - npm Package Compare versions

Comparing version 1.1.3 to 1.1.4

2

package.json
{
"name": "eslint-plugin-annotation",
"version": "1.1.3",
"version": "1.1.4",
"description": "Lint rules to validate and auto-correct annotation-based policies",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -34,2 +34,3 @@ # eslint-plugin-annotation

'annotation/sort': 'error',
'annotation/unique': 'error',
}

@@ -36,0 +37,0 @@ }

@@ -39,3 +39,5 @@ import { createRule } from '../utils/createRule'

const elements = node.elements
const uniqueElements = Array.from(new Set(elements.map((element) => sourceCode.getText(element))))
const uniqueElements = Array.from(
new Set(elements.map((element) => (element === null ? '' : sourceCode.getText(element)))),
)

@@ -42,0 +44,0 @@ if (elements.length !== uniqueElements.length) {

@@ -37,2 +37,16 @@ import path from 'path'

},
{
code: `
// @unique
const mixed = [1, "2", null, true, false];
`,
filename: getFilename('main.ts'),
},
{
code: `
// @unique
const sparseArray = [1, 2, , 3];
`,
filename: getFilename('main.ts'),
},
],

@@ -64,3 +78,15 @@ invalid: [

},
{
code: `
// @unique
const sparseArray = [1, 2, , 1];
`,
errors: [{ messageId: 'duplicateValues', type: AST_NODE_TYPES.ArrayExpression }],
output: `
// @unique
const sparseArray = [1, 2, ];
`,
filename: getFilename('main.ts'),
},
],
})
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