Skip to content

Commit

Permalink
Merge pull request #5719 from dottharun/fix/eslint/separate-workflow
Browse files Browse the repository at this point in the history
fix: separate eslint check
  • Loading branch information
sudhanshutech authored Jul 23, 2024
2 parents 6606c3c + c6f8e92 commit 1c636ae
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 5 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/build-and-preview-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ jobs:
npm install
npm run noIndex
- name: Run Eslint
run: npm run checklint

- name: Zip Site
run: bash ./script.sh

Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Checks
on:
pull_request:
branches: [ master ]
types: [opened, synchronize, reopened]


jobs:
checks:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@master
with:
persist-credentials: false
fetch-depth: 1

- name: NPM Install
run: npm install

- name: Build
run: npm run build

- name: Run Eslint
run: npm run checklint
12 changes: 12 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,18 @@ git push -u origin <your_branch_name>

**15.** Once you’ve committed and pushed all of your changes to GitHub, go to the page for your fork on GitHub, select your development branch, and click the pull request button. Please ensure that you compare your feature branch to the desired branch of the repo you are supposed to make a PR to. If you need to make any adjustments to your pull request, just push the updates to GitHub. Your pull request will automatically track the changes in your development branch and update it.

### Lint Rules

Layer5 uses ESLint to maintain code quality and consistency in our UI code. Use this command to trigger a lint check:

```sh
make lint
```

> Note:
> - Eslint in Gatsby requires generating config files from CLI. Run `gatsby build` or `gatsby develop` if you face this error during linting.

## Signing-off on Commits

To contribute to this project, you must agree to the **Developer Certificate of
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,8 @@ build:
clean:
gatsby clean && make site

.PHONY: setup build site clean site-fast
## Run Eslint on your local machine.
lint:
npm run lint

.PHONY: setup build site clean site-fast lint
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const CodeBlock = ({ name, code }) => {
<label htmlFor={name} className="label">
Show Code
</label>
{showCode && (
{showCode && (
<Code codeString={code} language="javascript" />
)}
</div>
Expand Down

0 comments on commit 1c636ae

Please sign in to comment.