From fbc39d270f8cc5e8b933799d00b43434f4d26f3e Mon Sep 17 00:00:00 2001 From: zlocate <43764701+zlocate@users.noreply.github.com> Date: Sun, 23 Aug 2020 17:59:34 +0300 Subject: [PATCH] Added ESLint config draft --- .eslintignore | 1 + AhMyth-Server/.eslintrc.js | 24 ++++++++++++++++++++++++ AhMyth-Server/package.json | 16 +++++++++------- 3 files changed, 34 insertions(+), 7 deletions(-) create mode 100644 .eslintignore create mode 100644 AhMyth-Server/.eslintrc.js diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 00000000..0baf8092 --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +*.min.js \ No newline at end of file diff --git a/AhMyth-Server/.eslintrc.js b/AhMyth-Server/.eslintrc.js new file mode 100644 index 00000000..0422e3dd --- /dev/null +++ b/AhMyth-Server/.eslintrc.js @@ -0,0 +1,24 @@ +module.exports = { + env: { + browser: true, + commonjs: true, + es2020: true, + node: true, + }, + extends: [ + 'airbnb-base', + ], + parserOptions: { + ecmaVersion: 11, + }, + rules: { + indent: ['error', 4], + quotes: ['error', 'single'], + }, + globals: { + angulaer: 'writable', + electron: 'writable', + $appCtrl: 'writable', + logStatus: 'writable', + }, +}; diff --git a/AhMyth-Server/package.json b/AhMyth-Server/package.json index 76415297..7c8ca98b 100644 --- a/AhMyth-Server/package.json +++ b/AhMyth-Server/package.json @@ -1,7 +1,10 @@ { "main": "./app/main.js", "devDependencies": { - "electron": "1.6.11" + "electron": "1.6.11", + "eslint": "^7.7.0", + "eslint-config-airbnb-base": "^14.2.0", + "eslint-plugin-import": "^2.22.0" }, "license": "GNU GPLv3", "build": { @@ -13,7 +16,9 @@ "asarUnpack": "**/app/Factory/**/*" }, "scripts": { - "start": "electron ./app", + "start": "npx electron ./app", + "lint": "npx eslint ./app", + "lint:fix": "npx eslint ./app --fix --ignore-pattern *.min.*", "clean": "rm -rf ./dist", "pack": "npm run pack:linux32 && npm run pack:linux64 && npm run pack:win32 && npm run pack:win64", "pack:linux32": "electron-packager ./app $npm_package_name --out=dist/ --platform=linux --arch=ia32 --electron-version=1.6.11 --overwrite", @@ -24,10 +29,7 @@ "build:linux": "npm run build:linux32 && npm run build:linux64", "build:linux32": "build --linux deb --ia32", "build:linux64": "build --linux deb --x64", - "build:win": "npm run build:win32 && npm run build:win64", - "build:win32": "build --win --ia32", - "build:win64": "build --win --x64" - + "build:win": "npm run build:win32 && npm run build:win64" } -} \ No newline at end of file +}