diff --git a/.ci/azure-pipelines-lint.yml b/.ci/azure-pipelines-lint.yml deleted file mode 100644 index 8d9efbd73a..0000000000 --- a/.ci/azure-pipelines-lint.yml +++ /dev/null @@ -1,29 +0,0 @@ -jobs: -- job: Lint - displayName: 'Lint' - - pool: - vmImage: 'ubuntu-latest' - - steps: - - task: NodeTool@0 - displayName: 'Install Node' - inputs: - versionSpec: '12.x' - - - task: Cache@2 - displayName: 'Cache node_modules' - inputs: - key: 'yarn | yarn.lock' - path: 'node_modules' - - - script: 'yarn install --frozen-lockfile' - displayName: 'Install Dependencies' - env: - SKIP_PREPARE: 'true' - - - script: 'yarn run lint --quiet' - displayName: 'Run ESLint' - - - script: 'yarn run stylelint' - displayName: 'Run Stylelint' diff --git a/.ci/azure-pipelines.yml b/.ci/azure-pipelines.yml index 3d7a5f1cde..d3b77d41bc 100644 --- a/.ci/azure-pipelines.yml +++ b/.ci/azure-pipelines.yml @@ -13,5 +13,4 @@ pr: jobs: - template: azure-pipelines-build.yml -- template: azure-pipelines-lint.yml - template: azure-pipelines-package.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000000..244f14580f --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,56 @@ +name: Lint + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + run-eslint: + name: Run eslint + runs-on: ubuntu-latest + + steps: + - name: Check out Git repository + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v1 + with: + node-version: 12 + + - name: Install Node.js dependencies + run: yarn + env: + SKIP_PREPARE: true + + - name: Run eslint + uses: reviewdog/action-eslint@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + eslint_flags: 'src/' + + run-stylelint: + name: Run stylelint + runs-on: ubuntu-latest + + steps: + - name: Check out Git repository + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v1 + with: + node-version: 12 + + - name: Install Node.js dependencies + run: yarn + env: + SKIP_PREPARE: true + + - name: Run stylelint + uses: reviewdog/action-stylelint@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + stylelint_input: 'src/**/*.css' diff --git a/package.json b/package.json index d36251c10f..25ecb72b43 100644 --- a/package.json +++ b/package.json @@ -112,7 +112,7 @@ "prepare": "./scripts/prepare.sh", "build:development": "webpack --config webpack.dev.js", "build:production": "webpack --config webpack.prod.js", - "lint": "eslint \".\"", + "lint": "eslint \"src/\"", "stylelint": "yarn stylelint:css && yarn stylelint:scss", "stylelint:css": "stylelint \"src/**/*.css\"", "stylelint:scss": "stylelint --config=\".stylelintrc.scss.json\" \"src/**/*.scss\""