mirror of
https://github.com/oceanprotocol-archive/squid-js.git
synced 2024-02-02 15:31:51 +01:00
setup eslint & prettier
This commit is contained in:
parent
003144c867
commit
537b5a63ad
@ -4,12 +4,12 @@ root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
end_of_line = lf
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.md]
|
||||
insert_final_newline = false
|
||||
trim_trailing_whitespace = false
|
||||
[*.{json,yml,yaml,md}]
|
||||
indent_size = 2
|
||||
|
||||
|
38
.eslintrc
Normal file
38
.eslintrc
Normal file
@ -0,0 +1,38 @@
|
||||
{
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"sourceType": "module",
|
||||
"ecmaFeatures": {
|
||||
"jsx": false
|
||||
},
|
||||
"project": "./tsconfig.json"
|
||||
},
|
||||
"extends": [
|
||||
"oceanprotocol",
|
||||
"prettier/standard",
|
||||
"plugin:prettier/recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"prettier/@typescript-eslint"
|
||||
],
|
||||
"plugins": ["@typescript-eslint", "prettier"],
|
||||
"rules": {
|
||||
"@typescript-eslint/member-delimiter-style": [
|
||||
"error",
|
||||
{ "multiline": { "delimiter": "none" } }
|
||||
],
|
||||
"@typescript-eslint/indent": "off",
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"@typescript-eslint/no-non-null-assertion": "off",
|
||||
"@typescript-eslint/explicit-function-return-type": "off",
|
||||
"@typescript-eslint/explicit-member-accessibility": "off",
|
||||
"@typescript-eslint/no-var-requires": "off",
|
||||
"@typescript-eslint/no-use-before-define": "off",
|
||||
"@typescript-eslint/no-object-literal-type-assertion": "off",
|
||||
"@typescript-eslint/no-parameter-properties": "off"
|
||||
},
|
||||
"env": {
|
||||
"es6": true,
|
||||
"browser": true,
|
||||
"mocha": true
|
||||
}
|
||||
}
|
5
.prettierrc
Normal file
5
.prettierrc
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"semi": false,
|
||||
"singleQuote": true,
|
||||
"trailingComma": "none"
|
||||
}
|
1188
package-lock.json
generated
1188
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
26
package.json
26
package.json
@ -6,6 +6,12 @@
|
||||
"typings": "./dist/node/squid.d.ts",
|
||||
"browser": "./dist/browser/squid.cjs2.min.js",
|
||||
"scripts": {
|
||||
"start": "npm link @oceanprotocol/keeper-contracts @oceanprotocol/secret-store-client && npm run build:watch",
|
||||
"build": "npm run clean && npm run build:tsc && npm run build:dist",
|
||||
"build:tsc": "tsc --sourceMap",
|
||||
"build:metadata": "./scripts/get-metadata.js > src/metadata.json",
|
||||
"build:dist": "cross-env NODE_ENV=production webpack",
|
||||
"build:watch": "tsc -w",
|
||||
"test": "mocha",
|
||||
"test:watch": "mocha -w --watch-extensions js,ts,json",
|
||||
"test:cover": "nyc --report-dir coverage/unit mocha",
|
||||
@ -15,13 +21,8 @@
|
||||
"integration:watch": "mocha -w --watch-extensions js,ts,json --opts integration/mocha.opts",
|
||||
"integration:cover": "nyc --report-dir coverage/integration mocha --opts integration/mocha.opts",
|
||||
"clean": "rm -rf ./dist/ ./doc/ ./.nyc_output",
|
||||
"lint": "tslint -c tslint.json 'src/**/*.ts' 'test/**/*.ts' 'integration/**/*.ts'",
|
||||
"start": "npm link @oceanprotocol/keeper-contracts @oceanprotocol/secret-store-client && npm run build:watch",
|
||||
"build": "npm run clean && npm run build:tsc && npm run build:dist",
|
||||
"build:tsc": "tsc --sourceMap",
|
||||
"build:metadata": "./scripts/get-metadata.js > src/metadata.json",
|
||||
"build:dist": "cross-env NODE_ENV=production webpack",
|
||||
"build:watch": "tsc -w",
|
||||
"lint": "eslint --ignore-path .gitignore --ext .ts,.tsx .",
|
||||
"format": "prettier --parser typescript --ignore-path .gitignore --write '**/*.{js,jsx,ts,tsx}'",
|
||||
"doc": "typedoc --mode modules --out ./doc/ ./src/",
|
||||
"merge-coverages": "npx lcov-result-merger \"coverage/*/lcov.info\" coverage/lcov.info",
|
||||
"report-coverage": "npm run report-coverage:unit && npm run report-coverage:integration",
|
||||
@ -65,21 +66,26 @@
|
||||
"@types/mocha": "^5.2.7",
|
||||
"@types/node": "^12.0.5",
|
||||
"@types/node-fetch": "^2.3.5",
|
||||
"@typescript-eslint/eslint-plugin": "^1.10.2",
|
||||
"@typescript-eslint/parser": "^1.10.2",
|
||||
"auto-changelog": "^1.13.0",
|
||||
"chai": "^4.2.0",
|
||||
"chai-spies": "^1.0.0",
|
||||
"cross-env": "^5.2.0",
|
||||
"eslint": "^5.16.0",
|
||||
"eslint-config-oceanprotocol": "^1.3.0",
|
||||
"eslint-config-prettier": "^5.0.0",
|
||||
"eslint-plugin-prettier": "^3.1.0",
|
||||
"lcov-result-merger": "^3.1.0",
|
||||
"mocha": "^6.1.4",
|
||||
"mock-local-storage": "^1.1.8",
|
||||
"nyc": "^14.1.1",
|
||||
"release-it": "^12.3.0",
|
||||
"prettier": "^1.18.2",
|
||||
"source-map-support": "^0.5.12",
|
||||
"truffle-hdwallet-provider": "^1.0.10",
|
||||
"ts-node": "^8.2.0",
|
||||
"tslint": "^5.17.0",
|
||||
"typedoc": "^0.14.2",
|
||||
"typescript": "^3.4.3",
|
||||
"typescript": "^3.5.2",
|
||||
"uglifyjs-webpack-plugin": "^2.1.3",
|
||||
"webpack": "^4.33.0",
|
||||
"webpack-cli": "^3.3.2",
|
||||
|
19
tslint.json
19
tslint.json
@ -1,19 +0,0 @@
|
||||
{
|
||||
"defaultSeverity": "error",
|
||||
"extends": [
|
||||
"tslint:recommended"
|
||||
],
|
||||
"jsRules": {},
|
||||
"rules": {
|
||||
"object-literal-sort-keys": false,
|
||||
"interface-name": [true, "never-prefix"],
|
||||
"max-line-length": [true, 140],
|
||||
"semicolon": [
|
||||
true,
|
||||
"never"
|
||||
],
|
||||
"no-empty": [true, "allow-empty-catch", "allow-empty-functions"],
|
||||
"ordered-imports": false
|
||||
},
|
||||
"rulesDirectory": []
|
||||
}
|
Loading…
Reference in New Issue
Block a user