Unverified Commit 519e8c22 authored by 柯振旭's avatar 柯振旭
Browse files

Add eslint to check frontend codes style, closes #1463

parent 22d4ee94
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ jobs:
      - name: Compile
        run: |
          cd dolphinscheduler-ui
          npm run lint
          npm install node-sass --unsafe-perm
          npm install
          npm run build

dolphinscheduler-ui/.eslintrc

deleted100644 → 0
+0 −6
Original line number Diff line number Diff line
globals:
  $: true
  expect: true
rules:
  "no-new": "off"
  "no-labels": [2, {"allowLoop": true}]
+17 −0
Original line number Diff line number Diff line
env:
  browser: true
  es6: true
  jquery: true
extends:
  - 'plugin:vue/essential'
  - standard
globals:
  Atomics: readonly
  SharedArrayBuffer: readonly
  PUBLIC_PATH: readonly
parserOptions:
  ecmaVersion: 2018
  sourceType: module
plugins:
  - vue
rules: {}
+8 −0
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@
    "dev": "cross-env NODE_ENV=development webpack-dev-server --config ./build/webpack.config.dev.js",
    "clean": "rimraf dist",
    "start": "npm run dev",
    "lint": "eslint ./src --fix",
    "build:release": "npm run clean && cross-env NODE_ENV=production PUBLIC_PATH=/dolphinscheduler/ui webpack --config ./build/webpack.config.release.js"
  },
  "dependencies": {
@@ -50,6 +51,13 @@
    "css-loader": "^0.28.8",
    "cssnano": "4.1.10",
    "env-parse": "^1.0.5",
    "eslint": "^6.8.0",
    "eslint-config-standard": "^14.1.1",
    "eslint-plugin-import": "^2.20.2",
    "eslint-plugin-node": "^11.1.0",
    "eslint-plugin-promise": "^4.2.1",
    "eslint-plugin-standard": "^4.0.1",
    "eslint-plugin-vue": "^6.2.2",
    "file-loader": "^5.0.2",
    "globby": "^8.0.1",
    "html-loader": "^0.5.5",
+5 −5
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ import'bootstrap/dist/js/bootstrap.min.js'
import 'canvg/dist/browser/canvg.min.js'

// Component internationalization
let useOpt = i18n.globalScope.LOCALE === 'en_US' ? { locale: en_US } : {}
const useOpt = i18n.globalScope.LOCALE === 'en_US' ? { locale: en_US } : {}

// Vue.use(ans)
Vue.use(ans, useOpt)
@@ -74,7 +74,7 @@ Permissions.request().then(res => {
    methods: {
      initApp () {
        $('.global-loading').hide()
        let bootstrapTooltip = $.fn.tooltip.noConflict()
        const bootstrapTooltip = $.fn.tooltip.noConflict()
        $.fn.tooltip = bootstrapTooltip
        $('body').tooltip({
          selector: '[data-toggle="tooltip"]',
Loading