Skip to content

Commit

Permalink
Merge pull request #41 from dtinit/alex-31-js-lint
Browse files Browse the repository at this point in the history
Setup ESLint
  • Loading branch information
alexbainter authored Feb 28, 2024
2 parents 923f56b + c4d150a commit 1a20e68
Show file tree
Hide file tree
Showing 7 changed files with 1,214 additions and 14 deletions.
10 changes: 10 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"env": {
"browser": true,
"es6": true
},
"extends": "eslint:recommended",
"ignorePatterns": ["*.min.js"],
"rules": {
}
}
19 changes: 19 additions & 0 deletions .github/workflows/lint-js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Lint JavaScript

on:
pull_request:
branches: [main]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2

- name: Install npm dependencies
run: npm ci

- name: Lint
run: npm run lint

13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,16 @@ python -m pip install -r requirements.txt
```

9. To populate your local database with articles from https://github.com/dtinit/portability-articles, go to https://localhost:8000/dj-admin and enter your superuser credentials from step 7. Click on "Articles" (under "Core"), and then press the "Populate Articles" button in the top right.

### Frontend

Frontend dev tools like ESLint are delivered via [npm](https://www.npmjs.com/), which is included with Node.js. To use the tools locally, you'll need to:

1. Install [Node.js](https://nodejs.org).
2. Run `npm install` wherever you cloned this repository to.

#### Linting with ESLint

You can run the linter by executing `npm run lint`. If there are no issues, there won't be any output.

To get linting feedback right in your code editor, [check here](https://eslint.org/docs/latest/use/integrations) to find an ESLint integration or instructions for your editor. The configuration file is named [.eslintrc.json](.eslintrc.json), but your editor/integration will probably find it for you.
Loading

0 comments on commit 1a20e68

Please sign in to comment.