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

@withfig/eslint-plugin-fig-linter

Package Overview
Dependencies
Maintainers
5
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@withfig/eslint-plugin-fig-linter - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

2

package.json
{
"name": "@withfig/eslint-plugin-fig-linter",
"version": "1.1.0",
"version": "1.1.1",
"description": "This is a eslint plugin which is tailored for fig specs",

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

@@ -8,29 +8,24 @@ module.exports = {

return {
Property(node) {
const keyName = node.key.name;
if (keyName === "insertValue") {
if (node.parent.type === "ObjectExpression") {
const nameProp = node.parent.properties.find(
(prop) => prop.key.name === "name"
);
'ObjectExpression > Property[key.name="insertValue"]': function (node) {
const nameProp = node.parent.properties.find(
(prop) => prop?.key?.name === "name"
);
if (!nameProp) return;
if (!nameProp) return;
const insertValue = node.value.value;
const nameValue = nameProp.value.value;
const insertValue = node.value.value;
const nameValue = nameProp.value.value;
if (!insertValue || !nameValue) return;
if (insertValue.trim() === nameValue.trim()) {
context.report({
node,
message:
"The insertValue prop can be omitted if the value is the same as name",
fix(fixer) {
const [start, end] = node.range;
// TODO: check if there is a comma after the prop before removing end + 1
return fixer.removeRange([start, end + 1]);
},
});
}
}
if (!insertValue || !nameValue) return;
if (insertValue.trim() === nameValue.trim()) {
context.report({
node,
message:
"The insertValue prop can be omitted if the value is the same as name",
fix(fixer) {
const [start, end] = node.range;
// TODO: check if there is a comma after the prop before removing end + 1
return fixer.removeRange([start, end + 1]);
},
});
}

@@ -37,0 +32,0 @@ },

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