remix lib linting done

pull/8/head
aniket-engg 4 years ago
parent c63d39985a
commit e08c349367
  1. 4
      libs/remix-analyzer/src/solidity-analyzer/index.ts
  2. 4
      libs/remix-analyzer/src/solidity-analyzer/modules/staticAnalysisCommon.ts
  3. 2
      libs/remix-analyzer/tsconfig.lib.json
  4. 16
      libs/remix-lib/.eslintrc
  5. 2
      libs/remix-lib/src/code/disassembler.js
  6. 1
      libs/remix-lib/src/execution/txRunner.js
  7. 1
      libs/remix-lib/src/universalDapp.js
  8. 9
      nx.json
  9. 19681
      package-lock.json
  10. 2
      package.json
  11. 28
      workspace.json

@ -1,7 +1,7 @@
'use strict' 'use strict'
import { AstWalker } from 'remix-astwalker' import { AstWalker } from '@remix-project/remix-astwalker'
import list from './modules/list' import list from './modules/list'
import { CompilationResult, AnalyzerModule, AnalysisReportObj, AnalysisReport } from 'types' import { CompilationResult, AnalyzerModule, AnalysisReportObj, AnalysisReport } from '../types'
type ModuleObj = { type ModuleObj = {
name: string name: string

@ -3,8 +3,8 @@
import { FunctionDefinitionAstNode, ModifierDefinitionAstNode, ParameterListAstNode, ForStatementAstNode, import { FunctionDefinitionAstNode, ModifierDefinitionAstNode, ParameterListAstNode, ForStatementAstNode,
WhileStatementAstNode, VariableDeclarationAstNode, ContractDefinitionAstNode, InheritanceSpecifierAstNode, WhileStatementAstNode, VariableDeclarationAstNode, ContractDefinitionAstNode, InheritanceSpecifierAstNode,
MemberAccessAstNode, BinaryOperationAstNode, FunctionCallAstNode, ExpressionStatementAstNode, UnaryOperationAstNode, MemberAccessAstNode, BinaryOperationAstNode, FunctionCallAstNode, ExpressionStatementAstNode, UnaryOperationAstNode,
IdentifierAstNode, IndexAccessAstNode, BlockAstNode, AssignmentAstNode, InlineAssemblyAstNode, IfStatementAstNode, CompiledContractObj, ABIParameter } from "types" IdentifierAstNode, IndexAccessAstNode, BlockAstNode, AssignmentAstNode, InlineAssemblyAstNode, IfStatementAstNode, CompiledContractObj, ABIParameter } from "../../types"
import { util } from 'remix-lib' import { util } from '@remix-project/remix-lib'
type SpecialObjDetail = { type SpecialObjDetail = {
obj: string obj: string

@ -4,7 +4,7 @@
"module": "commonjs", "module": "commonjs",
"outDir": "../../dist/out-tsc", "outDir": "../../dist/out-tsc",
"declaration": true, "declaration": true,
"rootDir": "./src", "rootDir": "./",
"types": ["node"] "types": ["node"]
}, },
"exclude": ["**/*.spec.ts"], "exclude": ["**/*.spec.ts"],

@ -0,0 +1,16 @@
{
"extends": "../../.eslintrc",
"rules": {
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-this-alias": "off"
},
"env": {
"browser": true,
"amd": true,
"node": true,
"es6": true
},
"ignorePatterns": ["!**/*"]
}

@ -11,7 +11,9 @@ const createExpressions = function (instructions) {
expr.functional = false expr.functional = false
if (expr.name === 'JUMPDEST') { if (expr.name === 'JUMPDEST') {
expr.label = 'label' + (++labels) expr.label = 'label' + (++labels)
// eslint-disable-next-line no-empty
} else if (expr.name.slice(0, 3) === 'DUP') { } else if (expr.name.slice(0, 3) === 'DUP') {
// eslint-disable-next-line no-empty
} else if (expr.name.slice(0, 4) === 'SWAP') { } else if (expr.name.slice(0, 4) === 'SWAP') {
} else if (expr.out <= 1 && expr.in <= expressions.length) { } else if (expr.out <= 1 && expr.in <= expressions.length) {
let error = false let error = false

@ -56,6 +56,7 @@ class TxRunner {
} }
this.event.trigger('transactionBroadcasted', [resp]) this.event.trigger('transactionBroadcasted', [resp])
var listenOnResponse = () => { var listenOnResponse = () => {
// eslint-disable-next-line no-async-promise-executor
return new Promise(async (resolve, reject) => { return new Promise(async (resolve, reject) => {
const result = await tryTillReceiptAvailable(resp, this.executionContext) const result = await tryTillReceiptAvailable(resp, this.executionContext)
tx = await tryTillTxAvailable(resp, this.executionContext) tx = await tryTillTxAvailable(resp, this.executionContext)

@ -377,6 +377,7 @@ module.exports = class UniversalDApp {
if (error && (typeof (error) !== 'string')) { if (error && (typeof (error) !== 'string')) {
if (error.message) error = error.message if (error.message) error = error.message
else { else {
// eslint-disable-next-line no-empty
try { error = 'error: ' + JSON.stringify(error) } catch (e) {} try { error = 'error: ' + JSON.stringify(error) } catch (e) {}
} }
} }

@ -19,12 +19,15 @@
} }
}, },
"projects": { "projects": {
"remix-astwalker": {
"tags": []
},
"remix-lib": { "remix-lib": {
"tags": [] "tags": []
}, },
"remix-astwalker": {
"tags": [],
"implicitDependencies": [
"remix-lib"
]
},
"remix-analyzer": { "remix-analyzer": {
"tags": [], "tags": [],
"implicitDependencies": [ "implicitDependencies": [

19681
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -145,8 +145,10 @@
"@fortawesome/fontawesome-free": "^5.8.1", "@fortawesome/fontawesome-free": "^5.8.1",
"@nrwl/eslint-plugin-nx": "^9.4.4", "@nrwl/eslint-plugin-nx": "^9.4.4",
"@nrwl/linter": "^9.3.0", "@nrwl/linter": "^9.3.0",
"@nrwl/node": "^9.4.5",
"@nrwl/workspace": "9.2.4", "@nrwl/workspace": "9.2.4",
"@remix-project/remix-analyzer": "0.5.2", "@remix-project/remix-analyzer": "0.5.2",
"@remix-project/remix-astwalker": "0.5.2",
"@remix-project/remix-debug": "0.4.4", "@remix-project/remix-debug": "0.4.4",
"@remix-project/remix-lib": "0.4.29", "@remix-project/remix-lib": "0.4.29",
"@remix-project/remix-simulator": "0.1.9-beta.5", "@remix-project/remix-simulator": "0.1.9-beta.5",

@ -99,17 +99,13 @@
} }
}, },
"build": { "build": {
"builder": "@nrwl/workspace:run-commands", "builder": "@nrwl/node:package",
"options": { "options": {
"commands": [ "outputPath": "dist/libs/remix-analyzer",
{ "tsConfig": "libs/remix-analyzer/tsconfig.lib.json",
"command": "rm -rf ../../dist" "packageJson": "libs/remix-analyzer/package.json",
}, "main": "libs/remix-analyzer/src/index.ts",
{ "assets": ["libs/remix-analyzer/*.md"]
"command": "./../../node_modules/.bin/npm-run-all build"
}
],
"cwd": "libs/remix-analyzer"
} }
} }
} }
@ -201,14 +197,14 @@
"schematics": {}, "schematics": {},
"architect": { "architect": {
"lint": { "lint": {
"builder": "@nrwl/workspace:run-commands", "builder": "@nrwl/linter:lint",
"options": { "options": {
"commands": [ "linter": "eslint",
{ "config": "libs/remix-lib/.eslintrc",
"command": "./../../node_modules/.bin/npm-run-all lint" "files": [
} "libs/remix-lib/**/*.js"
], ],
"cwd": "libs/remix-lib" "exclude": ["**/node_modules/**", "libs/remix-lib/test/**/*"]
} }
}, },
"test": { "test": {

Loading…
Cancel
Save