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

eslint-plugin-shopify

Package Overview
Dependencies
Maintainers
2
Versions
122
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-shopify - npm Package Compare versions

Comparing version 2.0.1 to 2.1.0

4

lib/rules/binary-assignment-parens.js

@@ -16,5 +16,5 @@ /* eslint no-unused-vars:0, no-console: 0 */

var beforeToken = context.getTokenBefore(node);
var hasBeforeParen = beforeToken && beforeToken.type === 'Punctuator' && beforeToken.value === '(';
var hasBeforeParen = beforeToken && (beforeToken.type === 'Punctuator') && (beforeToken.value === '(');
var afterToken = context.getTokenAfter(node);
var hasAfterParen = afterToken && afterToken.type === 'Punctuator' && afterToken.value === ')';
var hasAfterParen = afterToken && (afterToken.type === 'Punctuator') && (afterToken.value === ')');

@@ -21,0 +21,0 @@ return hasBeforeParen && hasAfterParen;

var ALWAYS_MESSAGE = 'You must include a @flow declaration at the top of your file.';
var NEVER_MESSAGE = 'You must not include a @flow declaration in your file.';
var EXPLICIT_MESSAGE = 'You must include a @flow or @noflow declaration at the top of your file.';
var FLOW_REGEX = /@flow/;
var EXPLICIT_FLOW_REGEX = /@(no)?flow/;
function commentIsFlowDirective(comment) {
return Boolean(comment) && comment.type === 'Block' && comment.start === 0 && FLOW_REGEX.test(comment.value);
function commentIsFlowDirective(comment, regex) {
return Boolean(comment) && comment.type === 'Block' && comment.start === 0 && regex.test(comment.value);
}

@@ -15,3 +17,3 @@

var commentNode = node.comments && node.comments[0];
var isFlowDirective = commentIsFlowDirective(commentNode);
var isFlowDirective = commentIsFlowDirective(commentNode, config === 'explicit' ? EXPLICIT_FLOW_REGEX : FLOW_REGEX);

@@ -25,2 +27,8 @@ switch (config) {

case 'explicit':
if (!isFlowDirective) {
context.report(node, EXPLICIT_MESSAGE);
}
break;
case 'never':

@@ -37,3 +45,3 @@ if (isFlowDirective) {

module.exports.schema = [{
enum: ['always', 'never'],
enum: ['always', 'explicit', 'never'],
}];
{
"name": "eslint-plugin-shopify",
"version": "2.0.1",
"version": "2.1.0",
"description": "Shopify-specific ESLint rules.",

@@ -16,3 +16,3 @@ "repository": {

"scripts": {
"lint": "node_modules/.bin/eslint .",
"lint": "node_modules/.bin/eslint . --max-warnings 0",
"test:unit": "istanbul cover --dir reports/coverage node_modules/.bin/_mocha tests/**/*.js -- --reporter dot",

@@ -35,3 +35,5 @@ "test": "npm run lint && npm run test:unit"

"eslint": "^1.5.0",
"eslint-config-shopify": ">=5.3.0",
"eslint-config-shopify": "^5.6.0",
"eslint-plugin-shopify": "file:.",
"eslint-plugin-react": "*",
"istanbul": "^0.3.20",

@@ -38,0 +40,0 @@ "mocha": "^2.3.2"

@@ -57,2 +57,6 @@ # eslint-plugin-shopify

### 2.1.0 - January 19, 2016
Add `explicit` option to `require-flow` rule to support either `@flow` or `@noflow`.
### 2.0.1 - October 20, 2015

@@ -59,0 +63,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