1
0
mirror of https://github.com/oceanprotocol-archive/squid-js.git synced 2024-02-02 15:31:51 +01:00

setup linting

This commit is contained in:
Matthias Kretschmann 2018-09-06 17:23:20 +02:00
parent e87b6fc421
commit 35d22a5a68
Signed by: m
GPG Key ID: 606EEEF3C479A91F
8 changed files with 1158 additions and 7 deletions

View File

@ -1,3 +1,3 @@
{ {
"extends": ["oceanprotocol", "oceanprotocol/react"] "extends": ["oceanprotocol"]
} }

View File

@ -13,10 +13,11 @@ matrix:
fast_finish: true fast_finish: true
before_install: before_install:
- npm install -g npm - npm install -g npm
script: script:
- npm run build - npm test
- npm run build
notifications: notifications:
email: false email: false

View File

@ -7,6 +7,7 @@
[![Travis (.com)](https://img.shields.io/travis/com/oceanprotocol/squid-js.svg)](https://travis-ci.com/oceanprotocol/squid-js) [![Travis (.com)](https://img.shields.io/travis/com/oceanprotocol/squid-js.svg)](https://travis-ci.com/oceanprotocol/squid-js)
[![GitHub contributors](https://img.shields.io/github/contributors/oceanprotocol/squid-js.svg)](https://github.com/oceanprotocol/squid-js/graphs/contributors) [![GitHub contributors](https://img.shields.io/github/contributors/oceanprotocol/squid-js.svg)](https://github.com/oceanprotocol/squid-js/graphs/contributors)
[![js oceanprotocol](https://img.shields.io/badge/js-oceanprotocol-7b1173.svg)](https://github.com/oceanprotocol/eslint-config-oceanprotocol)
--- ---

1138
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -4,7 +4,7 @@
"description": "Ocean Protocol JavaScript Library", "description": "Ocean Protocol JavaScript Library",
"main": "dist/squid.js", "main": "dist/squid.js",
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1", "test": "eslint ./src",
"start": "babel src --watch --out-dir dist", "start": "babel src --watch --out-dir dist",
"build": "babel src --out-dir dist" "build": "babel src --out-dir dist"
}, },
@ -30,7 +30,15 @@
"@babel/core": "^7.0.0", "@babel/core": "^7.0.0",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0", "@babel/plugin-proposal-object-rest-spread": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.0.0", "@babel/plugin-transform-runtime": "^7.0.0",
"@babel/preset-env": "^7.0.0" "@babel/preset-env": "^7.0.0",
"eslint": "^5.5.0",
"eslint-config-oceanprotocol": "^1.2.0",
"eslint-config-standard": "^12.0.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-node": "^7.0.1",
"eslint-plugin-promise": "^4.0.0",
"eslint-plugin-security": "^1.4.0",
"eslint-plugin-standard": "^4.0.0"
}, },
"engines": { "engines": {
"node": ">=8 <10" "node": ">=8 <10"

View File

@ -1,4 +1,5 @@
/* global fetch */ /* global fetch */
/* eslint-disable no-console */
export default class OceanAgent { export default class OceanAgent {
constructor(connectionUrl) { constructor(connectionUrl) {

View File

@ -1,3 +1,5 @@
/* eslint-disable no-console */
import Web3 from 'web3' import Web3 from 'web3'
import ContractLoader from './contractLoader' import ContractLoader from './contractLoader'
@ -167,7 +169,7 @@ export default class OceanKeeper {
// Helper functions (private) // Helper functions (private)
_listenOnce(event, eventName, callback) { _listenOnce(event, eventName, callback) {
event.watch((error, result) => { event.watch((error, result) => { // eslint-disable-line security/detect-non-literal-fs-filename
event.stopWatching() event.stopWatching()
if (error) { if (error) {
console.log(`Error in keeper ${eventName} event: `, error) console.log(`Error in keeper ${eventName} event: `, error)