Setup eslint for remix-ide and master changes and branches

pull/3/head
ioedeveloper 5 years ago
parent 389499a7b5
commit 8b4ea4af78
  1. 3
      .env
  2. 40
      .gitignore
  3. 315
      apps/remix-ide/.eslintrc.json
  4. 2
      apps/remix-ide/ci/makeMockCompiler.js
  5. 2
      apps/remix-ide/nightwatch.js
  6. 20725
      package-lock.json
  7. 69
      package.json
  8. 1
      soljson.js
  9. 15
      workspace.json

@ -0,0 +1,3 @@
gist_token = <token>
account_passphrase = <passphrase>
account_password = <password>

40
.gitignore vendored

@ -0,0 +1,40 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
# compiled output
/dist
/tmp
/out-tsc
# dependencies
/node_modules
# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace
# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings
# System Files
.DS_Store
Thumbs.db

@ -0,0 +1,315 @@
{
"env": {
"browser": true,
"es6": true
},
"extends": "eslint:recommended",
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 11,
"sourceType": "module"
},
"rules": {
"accessor-pairs": "error",
"array-bracket-newline": "off",
"array-bracket-spacing": [
"off",
"never"
],
"array-callback-return": "off",
"array-element-newline": "off",
"arrow-body-style": "off",
"arrow-parens": [
"off",
"always"
],
"arrow-spacing": [
"error",
{
"after": true,
"before": true
}
],
"block-scoped-var": "off",
"block-spacing": "error",
"brace-style": [
"off",
"1tbs"
],
"callback-return": "off",
"camelcase": "off",
"capitalized-comments": "off",
"class-methods-use-this": "off",
"comma-dangle": "off",
"comma-spacing": [
"error",
{
"after": true,
"before": false
}
],
"comma-style": [
"error",
"last"
],
"complexity": "off",
"computed-property-spacing": [
"off",
"never"
],
"consistent-return": "off",
"consistent-this": "off",
"curly": "off",
"default-case": "error",
"default-case-last": "off",
"default-param-last": "off",
"dot-location": "off",
"dot-notation": "off",
"eol-last": "error",
"eqeqeq": "off",
"func-call-spacing": "error",
"func-name-matching": "error",
"func-names": "off",
"func-style": [
"off",
"declaration"
],
"function-call-argument-newline": [
"off",
"consistent"
],
"function-paren-newline": "off",
"generator-star-spacing": "error",
"global-require": "off",
"grouped-accessor-pairs": "error",
"guard-for-in": "off",
"handle-callback-err": "error",
"id-blacklist": "error",
"id-length": "off",
"id-match": "error",
"implicit-arrow-linebreak": [
"off",
"beside"
],
"indent": "off",
"indent-legacy": "off",
"init-declarations": "off",
"jsx-quotes": "error",
"key-spacing": "error",
"keyword-spacing": [
"error",
{
"after": true,
"before": true
}
],
"line-comment-position": "off",
"linebreak-style": [
"error",
"unix"
],
"lines-around-comment": "off",
"lines-around-directive": "off",
"lines-between-class-members": [
"off",
"always"
],
"max-classes-per-file": "off",
"max-depth": "off",
"max-len": "off",
"max-lines": "off",
"max-lines-per-function": "off",
"max-nested-callbacks": "error",
"max-params": "off",
"max-statements": "off",
"max-statements-per-line": "off",
"multiline-comment-style": [
"off",
"separate-lines"
],
"new-cap": "off",
"new-parens": "error",
"newline-after-var": "off",
"newline-before-return": "off",
"newline-per-chained-call": "off",
"no-alert": "error",
"no-array-constructor": "error",
"no-await-in-loop": "off",
"no-bitwise": "off",
"no-buffer-constructor": "error",
"no-caller": "error",
"no-catch-shadow": "error",
"no-confusing-arrow": "off",
"no-console": "off",
"no-constructor-return": "error",
"no-continue": "error",
"no-div-regex": "error",
"no-duplicate-imports": "error",
"no-else-return": "off",
"no-empty-function": "off",
"no-eq-null": "off",
"no-eval": "error",
"no-extend-native": "error",
"no-extra-bind": "error",
"no-extra-label": "error",
"no-extra-parens": "off",
"no-floating-decimal": "error",
"no-implicit-coercion": "off",
"no-implicit-globals": "error",
"no-implied-eval": "error",
"no-inline-comments": "off",
"no-invalid-this": "off",
"no-iterator": "error",
"no-label-var": "error",
"no-labels": "error",
"no-lone-blocks": "off",
"no-lonely-if": "off",
"no-loop-func": "off",
"no-magic-numbers": "off",
"no-mixed-operators": "off",
"no-mixed-requires": "error",
"no-multi-assign": "off",
"no-multi-spaces": "off",
"no-multi-str": "error",
"no-multiple-empty-lines": "error",
"no-native-reassign": "error",
"no-negated-condition": "off",
"no-negated-in-lhs": "error",
"no-nested-ternary": "off",
"no-new": "error",
"no-new-func": "error",
"no-new-object": "error",
"no-new-require": "error",
"no-new-wrappers": "error",
"no-octal-escape": "error",
"no-param-reassign": "off",
"no-path-concat": "error",
"no-plusplus": "off",
"no-process-env": "off",
"no-process-exit": "off",
"no-proto": "error",
"no-restricted-exports": "off",
"no-restricted-globals": "error",
"no-restricted-imports": "error",
"no-restricted-modules": "error",
"no-restricted-properties": "error",
"no-restricted-syntax": "error",
"no-return-assign": "error",
"no-return-await": "off",
"no-script-url": "error",
"no-self-compare": "error",
"no-sequences": "error",
"no-shadow": "off",
"no-spaced-func": "error",
"no-sync": "off",
"no-tabs": "error",
"no-template-curly-in-string": "error",
"no-ternary": "off",
"no-throw-literal": "error",
"no-trailing-spaces": "error",
"no-undef-init": "error",
"no-undefined": "off",
"no-underscore-dangle": "off",
"no-unmodified-loop-condition": "error",
"no-unneeded-ternary": "error",
"no-unused-expressions": "off",
"no-use-before-define": "off",
"no-useless-backreference": "off",
"no-useless-call": "error",
"no-useless-computed-key": "error",
"no-useless-concat": "off",
"no-useless-constructor": "error",
"no-useless-rename": "error",
"no-useless-return": "off",
"no-var": "off",
"no-void": "off",
"no-warning-comments": "off",
"no-whitespace-before-property": "error",
"nonblock-statement-body-position": "error",
"object-curly-newline": "off",
"object-curly-spacing": "off",
"object-shorthand": "off",
"one-var": "off",
"one-var-declaration-per-line": "error",
"operator-assignment": "off",
"operator-linebreak": "error",
"padded-blocks": "off",
"padding-line-between-statements": "error",
"prefer-arrow-callback": "off",
"prefer-const": "off",
"prefer-destructuring": "off",
"prefer-exponentiation-operator": "error",
"prefer-named-capture-group": "off",
"prefer-numeric-literals": "error",
"prefer-object-spread": "error",
"prefer-promise-reject-errors": "off",
"prefer-reflect": "off",
"prefer-regex-literals": "error",
"prefer-rest-params": "off",
"prefer-spread": "off",
"prefer-template": "off",
"quote-props": "off",
"quotes": "off",
"radix": "off",
"require-atomic-updates": "off",
"require-await": "off",
"require-jsdoc": "off",
"require-unicode-regexp": "off",
"rest-spread-spacing": "error",
"semi": "off",
"semi-spacing": "error",
"semi-style": "off",
"sort-keys": [
"off",
"asc"
],
"sort-vars": "off",
"space-before-blocks": "error",
"space-before-function-paren": "error",
"space-in-parens": [
"error",
"never"
],
"space-infix-ops": "error",
"space-unary-ops": "error",
"spaced-comment": [
"off",
"always"
],
"strict": "off",
"switch-colon-spacing": "off",
"symbol-description": "error",
"template-curly-spacing": [
"error",
"never"
],
"template-tag-spacing": [
"off",
"never"
],
"unicode-bom": [
"error",
"never"
],
"valid-jsdoc": "off",
"vars-on-top": "off",
"wrap-iife": "error",
"wrap-regex": "off",
"yield-star-spacing": "error",
"yoda": [
"error",
"never"
],
"no-unused-vars": "off",
"no-redeclare": "off",
"no-empty": "off",
"no-constant-condition": "off",
"no-async-promise-executor": "off",
"no-useless-catch": "off",
"no-extra-semi": "off",
"no-undef": "off"
}
}

@ -70,7 +70,7 @@ function replaceSolCompiler (results, solcSnapshot) {
console.log(solcSnapshot.version())
data = data + '\n\nvar mockCompilerVersion = \'' + solcSnapshot.version() + '\''
data = data + '\n\nvar mockData = ' + JSON.stringify(results) + ';\n'
fs.writeFile('./soljson.js', data, 'utf8', function (error) {
fs.writeFile('./apps/remix-ide/soljson.js', data, 'utf8', function (error) {
if (error) {
console.log(error)
process.exit(1)

@ -81,4 +81,4 @@ module.exports = {
}
}
}
}
}

20725
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -60,27 +60,27 @@
"nightwatch_parallel": "nightwatch -e chrome,firefox --config apps/remix-ide/nightwatch.js",
"nightwatch_local_firefox": "nightwatch --config apps/remix-ide/nightwatch.js --env firefox",
"nightwatch_local_chrome": "nightwatch --config apps/remix-ide/nightwatch.js --env chrome",
"nightwatch_local_ballot": "nightwatch ./apps/remix-ide/test-browser/tests/ballot.test.js --config nightwatch.js --env chrome ",
"nightwatch_local_libraryDeployment": "nightwatch ./apps/remix-ide/test-browser/tests/libraryDeployment.test.js --config nightwatch.js --env chrome ",
"nightwatch_local_solidityImport": "nightwatch ./apps/remix-ide/test-browser/tests/solidityImport.test.js --config nightwatch.js --env chrome ",
"nightwatch_local_recorder": "nightwatch ./apps/remix-ide/test-browser/tests/recorder.test.js --config nightwatch.js --env chrome ",
"nightwatch_local_transactionExecution": "nightwatch ./apps/remix-ide/test-browser/tests/transactionExecution.test.js --config nightwatch.js --env chrome ",
"nightwatch_local_staticAnalysis": "nightwatch ./apps/remix-ide/test-browser/tests/staticAnalysis.test.js --config nightwatch.js --env chrome ",
"nightwatch_local_signingMessage": "nightwatch ./apps/remix-ide/test-browser/tests/signingMessage.test.js --config nightwatch.js --env chrome ",
"nightwatch_local_specialFunctions": "nightwatch ./apps/remix-ide/test-browser/tests/specialFunctions.test.js --config nightwatch.js --env chrome ",
"nightwatch_local_solidityUnitTests": "nightwatch ./apps/remix-ide/test-browser/tests/solidityUnittests.test.js --config nightwatch.js --env chrome ",
"nightwatch_local_remixd": "nightwatch ./apps/remix-ide/test-browser/tests/remixd.test.js --config nightwatch.js --env chrome ",
"nightwatch_local_terminal": "nightwatch ./apps/remix-ide/test-browser/tests/terminal.test.js --config nightwatch.js --env chrome ",
"nightwatch_local_gist": "nightwatch ./apps/remix-ide/test-browser/tests/gist.test.js --config nightwatch.js --env chrome ",
"nightwatch_local_workspace": "nightwatch ./apps/remix-ide/test-browser/tests/workspace.test.js --config nightwatch.js --env chrome ",
"nightwatch_local_defaultLayout": "nightwatch ./apps/remix-ide/test-browser/tests/defaultLayout.test.js --config nightwatch.js --env chrome ",
"nightwatch_local_pluginManager": "nightwatch ./apps/remix-ide/test-browser/tests/pluginManager.test.js --config nightwatch.js --env chrome ",
"nightwatch_local_publishContract": "nightwatch ./apps/remix-ide/test-browser/tests/publishContract.test.js --config nightwatch.js --env chrome ",
"nightwatch_local_generalSettings": "nightwatch ./apps/remix-ide/test-browser/tests/generalSettings.test.js --config nightwatch.js --env chrome ",
"nightwatch_local_fileExplorer": "nightwatch ./apps/remix-ide/test-browser/tests/fileExplorer.test.js --config nightwatch.js --env chrome ",
"nightwatch_local_debugger": "nightwatch ./apps/remix-ide/test-browser/tests/debugger.test.js --config nightwatch.js --env chrome ",
"nightwatch_local_editor": "nightwatch ./apps/remix-ide/test-browser/tests/editor.test.js --config nightwatch.js --env chrome ",
"nightwatch_local_runAndDeploy": "nightwatch ./apps/remix-ide/test-browser/tests/runAndDeploy.js --config nightwatch.js --env chrome-runAndDeploy ",
"nightwatch_local_ballot": "nightwatch ./apps/remix-ide/test-browser/tests/ballot.test.js --config apps/remix-ide/nightwatch.js --env chrome ",
"nightwatch_local_libraryDeployment": "nightwatch ./apps/remix-ide/test-browser/tests/libraryDeployment.test.js --config apps/remix-ide/nightwatch.js --env chrome ",
"nightwatch_local_solidityImport": "nightwatch ./apps/remix-ide/test-browser/tests/solidityImport.test.js --config apps/remix-ide/nightwatch.js --env chrome ",
"nightwatch_local_recorder": "nightwatch ./apps/remix-ide/test-browser/tests/recorder.test.js --config apps/remix-ide/nightwatch.js --env chrome ",
"nightwatch_local_transactionExecution": "nightwatch ./apps/remix-ide/test-browser/tests/transactionExecution.test.js --config apps/remix-ide/nightwatch.js --env chrome ",
"nightwatch_local_staticAnalysis": "nightwatch ./apps/remix-ide/test-browser/tests/staticAnalysis.test.js --config apps/remix-ide/nightwatch.js --env chrome ",
"nightwatch_local_signingMessage": "nightwatch ./apps/remix-ide/test-browser/tests/signingMessage.test.js --config apps/remix-ide/nightwatch.js --env chrome ",
"nightwatch_local_specialFunctions": "nightwatch ./apps/remix-ide/test-browser/tests/specialFunctions.test.js --config apps/remix-ide/nightwatch.js --env chrome ",
"nightwatch_local_solidityUnitTests": "nightwatch ./apps/remix-ide/test-browser/tests/solidityUnittests.test.js --config apps/remix-ide/nightwatch.js --env chrome ",
"nightwatch_local_remixd": "nightwatch ./apps/remix-ide/test-browser/tests/remixd.test.js --config apps/remix-ide/nightwatch.js --env chrome ",
"nightwatch_local_terminal": "nightwatch ./apps/remix-ide/test-browser/tests/terminal.test.js --config apps/remix-ide/nightwatch.js --env chrome ",
"nightwatch_local_gist": "nightwatch ./apps/remix-ide/test-browser/tests/gist.test.js --config apps/remix-ide/nightwatch.js --env chrome ",
"nightwatch_local_workspace": "nightwatch ./apps/remix-ide/test-browser/tests/workspace.test.js --config apps/remix-ide/nightwatch.js --env chrome ",
"nightwatch_local_defaultLayout": "nightwatch ./apps/remix-ide/test-browser/tests/defaultLayout.test.js --config apps/remix-ide/nightwatch.js --env chrome ",
"nightwatch_local_pluginManager": "nightwatch ./apps/remix-ide/test-browser/tests/pluginManager.test.js --config apps/remix-ide/nightwatch.js --env chrome ",
"nightwatch_local_publishContract": "nightwatch ./apps/remix-ide/test-browser/tests/publishContract.test.js --config apps/remix-ide/nightwatch.js --env chrome ",
"nightwatch_local_generalSettings": "nightwatch ./apps/remix-ide/test-browser/tests/generalSettings.test.js --config apps/remix-ide/nightwatch.js --env chrome ",
"nightwatch_local_fileExplorer": "nightwatch ./apps/remix-ide/test-browser/tests/fileExplorer.test.js --config apps/remix-ide/nightwatch.js --env chrome ",
"nightwatch_local_debugger": "nightwatch ./apps/remix-ide/test-browser/tests/debugger.test.js --config apps/remix-ide/nightwatch.js --env chrome ",
"nightwatch_local_editor": "nightwatch ./apps/remix-ide/test-browser/tests/editor.test.js --config apps/remix-ide/nightwatch.js --env chrome ",
"nightwatch_local_runAndDeploy": "nightwatch ./apps/remix-ide/test-browser/tests/runAndDeploy.js --config apps/remix-ide/nightwatch.js --env chrome-runAndDeploy ",
"onchange": "onchange apps/remix-ide/build/app.js -- npm-run-all lint",
"prepublish": "mkdirp build; npm-run-all -ls downloadsolc_root build",
"remixd": "remixd -s ./apps/remix-ide/contracts --remix-ide http://127.0.0.1:8080",
@ -92,15 +92,6 @@
"reinstall": "rm ./node-modules/ -rf; rm package-lock.json; rm ./build/ -rf; npm install; npm run build",
"ganache-cli": "npx ganache-cli"
},
"standard": {
"ignore": [
"apps/remix-ide/build/",
"apps/remix-ide/src/app/editor/mode-solidity.js",
"apps/remix-ide/soljson.js",
"apps/remix-ide/assets/js/"
],
"parser": "babel-eslint"
},
"browserify": {
"transform": [
[
@ -138,17 +129,9 @@
"dependencies": {
"@remixproject/engine": "^0.2.3",
"http-server": "^0.11.1",
"remixd": "0.1.8-alpha.10",
"standard": "^8.5.0"
"remixd": "0.1.8-alpha.10"
},
"devDependencies": {
"@nrwl/workspace": "9.2.4",
"@types/node": "~8.9.4",
"ts-node": "~7.0.0",
"tslint": "~6.0.0",
"eslint": "6.8.0",
"typescript": "~3.8.3",
"prettier": "1.19.1",
"@babel/core": "^7.4.5",
"@babel/plugin-transform-object-assign": "^7.2.0",
"@babel/polyfill": "^7.4.4",
@ -158,7 +141,10 @@
"@babel/preset-stage-0": "^7.0.0",
"@babel/register": "^7.4.4",
"@fortawesome/fontawesome-free": "^5.8.1",
"@nrwl/linter": "^9.3.0",
"@nrwl/workspace": "9.2.4",
"@resolver-engine/imports": "^0.3.0",
"@types/node": "~8.9.4",
"ace-mode-move": "0.0.1",
"ace-mode-solidity": "^0.1.0",
"ace-mode-zokrates": "^1.0.0",
@ -177,6 +163,7 @@
"csslint": "^1.0.2",
"deep-equal": "^1.0.1",
"dotenv": "^8.2.0",
"eslint": "6.8.0",
"ethereumjs-util": "^6.2.0",
"ethers": "^4.0.27",
"events": "^3.0.0",
@ -201,6 +188,7 @@
"npm-merge-driver": "^2.3.5",
"npm-run-all": "^4.0.2",
"onchange": "^3.2.1",
"prettier": "1.19.1",
"remix-analyzer": "0.5.2",
"remix-debug": "0.4.4",
"remix-lib": "0.4.29",
@ -216,6 +204,9 @@
"solc": "^0.6.0",
"swarmgw": "^0.3.1",
"tape": "^4.5.1",
"ts-node": "~7.0.0",
"tslint": "~6.0.0",
"typescript": "~3.8.3",
"uglify-js": "^2.8.16",
"vm-browserify": "0.0.4",
"watchify": "^3.9.0",

File diff suppressed because one or more lines are too long

@ -41,9 +41,16 @@
"builder": "@nrwl/linter:lint",
"options": {
"linter": "eslint",
"config": "apps/remix-ide-e2e/.eslintrc",
"tsConfig": ["apps/remix-ide-e2e/tsconfig.e2e.json"],
"exclude": ["**/node_modules/**", "!apps/remix-ide-e2e/**"]
"config": "apps/remix-ide/.eslintrc.json",
"files": [
"apps/remix-ide/**/*.js"
],
"exclude": ["**/node_modules/**",
"apps/remix-ide/build/**/*.js",
"apps/remix-ide/src/app/editor/mode-solidity.js",
"apps/remix-ide/soljson.js",
"apps/remix-ide/assets/js/**/*.js"
]
}
},
"test": {
@ -51,7 +58,7 @@
"options": {
"commands": [
{
"command": "csslint && standard && node test/index.js"
"command": "csslint && node test/index.js"
}
]
}

Loading…
Cancel
Save