Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-storybook

Package Overview
Dependencies
Maintainers
2
Versions
114
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-storybook - npm Package Compare versions

Comparing version 0.11.2 to 0.11.3--canary.187.1af857a.0

20

dist/rules/default-exports.js

@@ -52,2 +52,3 @@ "use strict";

let hasDefaultExport = false;
let isCsf4Style = false;
let hasStoriesOfImport = false;

@@ -60,2 +61,19 @@ return {

},
VariableDeclaration(node) {
// we check for variables declared at the root in a CSF4 style
// e.g. const meta = config.meta({})
if (node.parent.type === 'Program') {
node.declarations.forEach((declaration) => {
const init = declaration.init;
if (init && init.type === 'CallExpression') {
const callee = init.callee;
if (callee.type === 'MemberExpression' &&
callee.property.type === 'Identifier' &&
callee.property.name === 'meta') {
isCsf4Style = true;
}
}
});
}
},
ExportDefaultSpecifier: function () {

@@ -68,3 +86,3 @@ hasDefaultExport = true;

'Program:exit': function (program) {
if (!hasDefaultExport && !hasStoriesOfImport) {
if (!isCsf4Style && !hasDefaultExport && !hasStoriesOfImport) {
const componentName = getComponentName(program, context.getFilename());

@@ -71,0 +89,0 @@ const firstNonImportStatement = program.body.find((n) => !(0, ast_1.isImportDeclaration)(n));

2

package.json
{
"name": "eslint-plugin-storybook",
"version": "0.11.2",
"version": "0.11.3--canary.187.1af857a.0",
"description": "Best practice rules for Storybook",

@@ -5,0 +5,0 @@ "keywords": [

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