eslint-plugin-webgl-logic
Advanced tools
Comparing version 1.4.0 to 1.5.0
{ | ||
"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" |
10
index.js
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
87557
17
2234