diff --git a/.github/linters/.eslintrc.json b/.github/linters/.eslintrc.json deleted file mode 100644 index 7cdfe7ebdb..0000000000 --- a/.github/linters/.eslintrc.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "env": { - "es6": true, - "browser": true - }, - "parser": "babel-eslint", - "parserOptions": { - "sourceType": "script", - "ecmaFeatures": { - "globalReturn": false - } - }, - "extends": ["eslint:recommended", "prettier"], - "rules": { - "no-console": "warn", - "no-mixed-spaces-and-tabs": "warn", - "no-unused-vars": "warn", - "no-use-before-define": "error", - "prefer-const": [ - "warn", - { - "destructuring": "any", - "ignoreReadBeforeAssign": true - } - ], - "no-undef": "error", - "indent": ["warn", 4, { "SwitchCase": 1 }], - "quotes": ["warn", "double", { "avoidEscape": true }], - "semi": "error", - "max-len": [ - "warn", - { - "code": 100, - "ignoreTrailingComments": true, - "ignoreComments": true, - "ignoreStrings": true, - "ignoreTemplateLiterals": true - } - ], - "no-trailing-spaces": ["warn", { "skipBlankLines": true, "ignoreComments": true }], - "no-duplicate-case": "error", - "no-irregular-whitespace": "warn" - } -} diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index ad1fe7287d..7b5dae821a 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -1,6 +1,5 @@ -name: Super-Linter +name: ESLint -# Triggers the workflow on push or pull request events only for the master branch on: push: branches: [master] @@ -9,21 +8,35 @@ on: jobs: build: - name: Lint updated JavaScript files + name: Lint updated JavaScript files with ESLint - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - name: Checkout code - # Checks-out repository under $GITHUB_WORKSPACE, so job can access it uses: actions/checkout@v2 with: - # Full git history is needed to get a proper list of changed files within `super-linter` fetch-depth: 0 + + - name: Use Node.js + uses: actions/setup-node@v1 + with: + node-version: 12.x + + - name: Get changed files + id: getfile + run: echo "::set-output name=files::$(git diff-tree --no-commit-id --name-only -r ${{ github.sha }} | xargs)" + + - name: Install ESLint + run: npm install eslint - - name: Run Super-Linter - uses: github/super-linter@v3 - env: - VALIDATE_ALL_CODEBASE: false - VALIDATE_JAVASCRIPT_STANDARD: false # VALIDATE_JAVASCRIPT_ES is desired (true by default) - VALIDATE_JSCPD: false + - name: Lint changed files using ESLint + run: | + for i in ${{ steps.getfile.outputs.files }} + do + if [[ "$i" == *".js" ]] + then + echo "linting $i" + npx eslint $i + fi + done diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 71860699ff..fc0cf6a1af 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -1,7 +1,7 @@ # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions -name: Node.js CI +name: Smoke Test on: push: @@ -11,18 +11,22 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 strategy: matrix: node-version: [12.x, 14.x] steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - run: npm ci - - run: npm run build --if-present - - run: npm test + - name: Checkout code + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + + - run: npm ci + - run: npm run build --if-present