mirror of
https://github.com/sexybiggetje/pixdisp.git
synced 2024-11-21 20:41:03 +01:00
Add eslint-plugin-security and config
This commit is contained in:
parent
38d395d587
commit
740995190e
4 changed files with 40 additions and 8 deletions
|
@ -3,7 +3,13 @@
|
||||||
"es6": true,
|
"es6": true,
|
||||||
"node": true
|
"node": true
|
||||||
},
|
},
|
||||||
"extends": "eslint:recommended",
|
"plugins": [
|
||||||
|
"security"
|
||||||
|
],
|
||||||
|
"extends": [
|
||||||
|
"eslint:recommended",
|
||||||
|
"plugin:security/recommended"
|
||||||
|
],
|
||||||
"parserOptions": {
|
"parserOptions": {
|
||||||
"sourceType": "module"
|
"sourceType": "module"
|
||||||
},
|
},
|
||||||
|
@ -25,6 +31,8 @@
|
||||||
"always"
|
"always"
|
||||||
],
|
],
|
||||||
"no-case-declarations": "off",
|
"no-case-declarations": "off",
|
||||||
"no-console": "off"
|
"no-console": "off",
|
||||||
|
"security/detect-new-buffer": "off",
|
||||||
|
"security/detect-object-injection": "off"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -9,16 +9,15 @@ class PimoroniUnicorn extends Driver {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.spi = false;
|
this.spi = false;
|
||||||
this.spiPath = '/dev/spidev0.0';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
write( buffer ) {
|
write( buffer ) {
|
||||||
if ( this.spi === false) {
|
if ( this.spi === false) {
|
||||||
if ( fs.existsSync( this.spiPath ) ) {
|
if ( fs.existsSync( '/dev/spidev0.0' ) ) {
|
||||||
let SPI = require( 'pi-spi' );
|
let SPI = require( 'pi-spi' );
|
||||||
this.spi = SPI.initialize( this.spiPath );
|
this.spi = SPI.initialize( '/dev/spidev0.0' );
|
||||||
} else {
|
} else {
|
||||||
console.warn( 'Device path ' + this.spiPath + ' was unavailable.' );
|
console.warn( 'Device path \'/dev/spidev0.0\' was unavailable.' );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
28
package-lock.json
generated
28
package-lock.json
generated
|
@ -1027,6 +1027,15 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"eslint-plugin-security": {
|
||||||
|
"version": "1.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/eslint-plugin-security/-/eslint-plugin-security-1.4.0.tgz",
|
||||||
|
"integrity": "sha512-xlS7P2PLMXeqfhyf3NpqbvbnW04kN8M9NtmhpR3XGyOvt/vNKS7XPXT5EDbwKW9vCjWH4PpfQvgD/+JgN0VJKA==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"safe-regex": "1.1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"eslint-scope": {
|
"eslint-scope": {
|
||||||
"version": "3.7.1",
|
"version": "3.7.1",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.1.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.1.tgz",
|
||||||
|
@ -1506,7 +1515,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"debug": {
|
"debug": {
|
||||||
"version": "2.6.9",
|
"version": "2.6.8",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
|
@ -2146,7 +2155,7 @@
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"debug": "2.6.9",
|
"debug": "2.6.8",
|
||||||
"fstream": "1.0.11",
|
"fstream": "1.0.11",
|
||||||
"fstream-ignore": "1.0.5",
|
"fstream-ignore": "1.0.5",
|
||||||
"once": "1.4.0",
|
"once": "1.4.0",
|
||||||
|
@ -4831,6 +4840,12 @@
|
||||||
"signal-exit": "3.0.2"
|
"signal-exit": "3.0.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"ret": {
|
||||||
|
"version": "0.1.15",
|
||||||
|
"resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz",
|
||||||
|
"integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"right-align": {
|
"right-align": {
|
||||||
"version": "0.1.3",
|
"version": "0.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz",
|
||||||
|
@ -4880,6 +4895,15 @@
|
||||||
"integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==",
|
"integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"safe-regex": {
|
||||||
|
"version": "1.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz",
|
||||||
|
"integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"ret": "0.1.15"
|
||||||
|
}
|
||||||
|
},
|
||||||
"sane": {
|
"sane": {
|
||||||
"version": "2.2.0",
|
"version": "2.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/sane/-/sane-2.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/sane/-/sane-2.2.0.tgz",
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"eslint": "^4.15.0",
|
"eslint": "^4.15.0",
|
||||||
|
"eslint-plugin-security": "^1.4.0",
|
||||||
"jest": "^22.0.4"
|
"jest": "^22.0.4"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
Loading…
Reference in a new issue