GithubHelp home page GithubHelp logo

cdebotton / eslint-action Goto Github PK

View Code? Open in Web Editor NEW

This project forked from stefanoeb/eslint-action

0.0 0.0 0.0 22 KB

Github action that runs ESLint on javascript code.

License: MIT License

Shell 88.68% Dockerfile 11.32%

eslint-action's Introduction

⚠️⚠️⚠️ You don't need this action ⚠️⚠️⚠️

Github Actions have everything that you need to run your eslint out of the box now, to do that simply use the run commands like so:

name: CI
on: push
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Install modules
      run: yarn
    - name: Run ESLint
      run: eslint . --ext .js,.jsx,.ts,.tsx

This action executes ESLint linter on specified javascript files without any previous action/build step or Docker required.

Prerequisites

ESLint

You must have the ESLint running locally for the action to execute. It will use the same rules as you do locally. More info on the ESLint getting started guide

Usage

main.yml

Add to your existing main.yml file or create a new file named .github/workflows/lint.yml and copy over one of the examples below to your new workflow file

This is the simplest example to get it running:

name: Lint

on: [push]

jobs:
  eslint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v1
      - uses: stefanoeb/[email protected]

By default it will run ESLint through all the files in the project. But you can also specify a glob of files to lint using the with: argument on your YAML file. The example below shows ESLint running only on the files under the src/ folder:

name: Lint

on: [push]

jobs:
  eslint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v1
      - uses: stefanoeb/[email protected]
        with:
          files: src/

If there is no previous step installing the necessary modules, this action will execute a yarn install or npm install automatically.

License

The Dockerfile and associated scripts and documentation in this project are released under the MIT License.

eslint-action's People

Contributors

bbosman avatar plata avatar raineorshine avatar rdil avatar stefanoeb avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.