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

@esri/eslint-plugin-calcite-components

Package Overview
Dependencies
Maintainers
41
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@esri/eslint-plugin-calcite-components - npm Package Compare versions

Comparing version 0.2.3-next.4 to 0.2.3-next.5

67

dist/index.js
/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://github.com/Esri/calcite-design-system/blob/0.2.3-next.3/LICENSE.md for details.
See https://github.com/Esri/calcite-design-system/blob/0.2.3-next.4/LICENSE.md for details.
*/

@@ -9,3 +9,3 @@ 'use strict';

const rule$3 = {
const rule$4 = {
meta: {

@@ -84,3 +84,3 @@ docs: {

eventHandlerPropLikePattern.test(attributeName);
const rule$2 = {
const rule$3 = {
meta: {

@@ -123,2 +123,36 @@ docs: {

const rule$2 = {
meta: {
docs: {
description: `This ensures the node passed into the ref callback is in sync with its JSX attributes/properties when invoked.`,
recommended: true,
},
fixable: "code",
schema: [],
type: "problem",
},
create(context) {
return {
JSXIdentifier(node) {
const openingElement = node.parent;
if (openingElement.type === "JSXOpeningElement") {
const attributes = [];
openingElement.attributes.forEach((attr) => {
if (attr.type === "JSXAttribute" && attr.name?.type === "JSXIdentifier") {
attributes.push(attr.name.name);
}
});
const refAttribute = attributes.find((attr) => attr === "ref");
if (refAttribute && attributes.indexOf(refAttribute) !== attributes.length - 1) {
context.report({
node,
message: `"ref" prop should be placed last in JSX to ensure the node attrs/props are in sync.`,
});
}
}
},
};
},
};
// @ts-ignore

@@ -196,6 +230,7 @@ const rule$1 = {

var index$1 = {
"ban-events": rule$3,
"ban-props-on-host": rule$2,
"ban-events": rule$4,
"ban-props-on-host": rule$3,
"enforce-ref-last-prop": rule$2,
"require-event-emitter-type": rule$1,
"strict-boolean-attributes": rule
"strict-boolean-attributes": rule,
};

@@ -212,8 +247,8 @@

ecmaFeatures: {
jsx: true
}
jsx: true,
},
},
env: {
es2020: true,
browser: true
browser: true,
},

@@ -223,7 +258,8 @@ plugins: ["@esri/calcite-components"],

"@esri/calcite-components/ban-props-on-host": 2,
"@esri/calcite-components/enforce-ref-last-prop": 2,
"@esri/calcite-components/require-event-emitter-type": 2,
"@esri/calcite-components/strict-boolean-attributes": 2
}
}
]
"@esri/calcite-components/strict-boolean-attributes": 2,
},
},
],
};

@@ -235,5 +271,6 @@

"@esri/calcite-components/ban-props-on-host": 2,
"@esri/calcite-components/enforce-ref-last-prop": 2,
"@esri/calcite-components/require-event-emitter-type": 2,
"@esri/calcite-components/strict-boolean-attributes": 2
}
"@esri/calcite-components/strict-boolean-attributes": 2,
},
};

@@ -240,0 +277,0 @@

{
"name": "@esri/eslint-plugin-calcite-components",
"version": "0.2.3-next.4",
"version": "0.2.3-next.5",
"description": "ESLint rules for @esri/calcite-components",

@@ -27,3 +27,3 @@ "main": "dist/index.js",

},
"gitHead": "7e40a34d226917809df76c3a15047071d051756f"
"gitHead": "4ef8b6730d9aac8b11e46feac71dd563990139e5"
}

@@ -38,3 +38,3 @@ # @esri/eslint-plugin-calcite-components

```
```shell
npm run lint

@@ -53,2 +53,6 @@ ```

- [`@esri/calcite-components/enforce-ref-last-prop`](./docs/enforce-ref-last-prop.md)
This ensures the node passed into the `ref` callback is in sync with its JSX attributes/properties when invoked.
- [`@esri/calcite-components/require-event-emitter-type`](./docs/require-event-emitter-type.md)

@@ -67,2 +71,3 @@

"@esri/calcite-components/ban-props-on-host": "error",
"@esri/calcite-components/enforce-ref-last-prop": "error",
"@esri/calcite-components/require-event-emitter-type": "error",

@@ -89,2 +94,2 @@ "@esri/calcite-components/strict-boolean-attributes": "error"

email: contracts@esri.com
email: <contracts@esri.com>
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