diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..1f669c9 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,30 @@ +name: react-lib CI + +on: + push: + branches: + - master + pull_request: + types: + - opened + - synchronize + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - name: Check out branch + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: 16 + cache: 'yarn' + + - name: Install dependencies + run: yarn install + + - name: Run lint + run: yarn lint diff --git a/package.json b/package.json index 4c5989a..588bc37 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,8 @@ "start": "yarn run mb watch --no-compress", "prepare": "run-s build", "test": "run-s test:unit test:lint test:build", - "lint": "yarn prettier ./src && eslint --quiet --ext .ts,.tsx ./src/", + "lint": "yarn prettier ./src && eslint --ext .ts,.tsx ./src/", + "lint:fix": "yarn prettier ./src && eslint --fix --ext .ts,.tsx ./src/", "test:build": "run-s build", "test:lint": "eslint .", "test:unit": "cross-env CI=1 react-scripts test --env=jsdom",