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

eslint-plugin-webgl-logic

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-webgl-logic - npm Package Compare versions

Comparing version 1.4.0 to 1.5.0

rules/enforceGameImports.js

4

flavio.json
{
"name": "eslint-plugin-webgl-logic",
"version": "1.4.0",
"version": "1.5.0",
"tag": {
"commit": "6009f12c165b16b4512f6c24ea5dbc842ae9cb80",
"commit": "5668ed1b2a1100efe557045614535379c4d76cd4",
"target": {

@@ -7,0 +7,0 @@ "branch": "master"

@@ -6,5 +6,7 @@ 'use strict';

var noPromiseAll = require( './rules/noPromiseAll.js' );
var noPromiseConstructor = require( './rules/noPromiseConstructor.js' );
var noPromiseRace = require( './rules/noPromiseRace.js' );
var noSetTimeout = require( './rules/noSetTimeout.js' );
var maxLinesPerFunction = require( './rules/maxLinesPerFunction.js' );
var enforceGameImports = require( './rules/enforceGameImports.js' );

@@ -16,5 +18,7 @@ module.exports = {

"noPromiseAll": noPromiseAll,
"noPromiseConstructor": noPromiseConstructor,
"noPromiseRace": noPromiseRace,
"noSetTimeout": noSetTimeout,
"maxLinesPerFunction": maxLinesPerFunction
"maxLinesPerFunction": maxLinesPerFunction,
"enforceGameImports": enforceGameImports
},

@@ -25,7 +29,9 @@ rulesConfig: {

"noPromiseAll": 2,
"noPromiseConstructor": 2,
"noPromiseRace": 2,
"noSetTimeout": 2,
"maxLinesPerFunction": 1
"maxLinesPerFunction": 1,
"enforceGameImports": 2
}
};
{
"name": "eslint-plugin-webgl-logic",
"version": "1.4.0",
"version": "1.5.0",
"description": "Custom eslint rules for the webgl logic module",
"main": "index.js",
"scripts": {
"test": "node test/test.js && node test/maxLinesPerFunction.js"
"test": "node test/test.js && node test/maxLinesPerFunction.js && node test/enforceGameImports.js"
},

@@ -9,0 +9,0 @@ "repository": {

@@ -0,0 +0,0 @@ # eslint-plugin-webgl-logic

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ 'use strict';

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

var noPromiseRace = require( "../rules/noPromiseRace.js" );
var noPromiseConstructor = require( "../rules/noPromiseConstructor.js" );
var noSetTimeout = require( "../rules/noSetTimeout.js" );

@@ -121,2 +122,32 @@ var RuleTester = require( "eslint" ).RuleTester;

ruleTester.run( "noPromiseConstructor", noPromiseConstructor, {
valid: [
"function prom() { return Promise.resolve(); }",
"function prom() { return Promise.reject(); }",
"Promise.someOtherProperty = {};"
],
invalid: [
{
code: "var val = new Promise( function( res, rej ) { return 0; } );",
errors: [{ message: "Promise constructor is forbidden" }]
},
{
code: "var val = new Promise( ( res, rej ) => { return 0; } );",
parser: 'babel-eslint',
errors: [{ message: "Promise constructor is forbidden" }]
},
{
code: "var val = new global.Promise( ( res, rej ) => { return 0; } );",
parser: 'babel-eslint',
errors: [{ message: "Promise constructor is forbidden" }]
},
{
code: "var val = new window.Promise( ( res, rej ) => { return 0; } );",
parser: 'babel-eslint',
errors: [{ message: "Promise constructor is forbidden" }]
}
]
} );
ruleTester.run( "noPromiseRace", noPromiseRace, {

@@ -123,0 +154,0 @@ valid: [

Sorry, the diff of this file is not supported yet

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