Skip to content

Commit

Permalink
add formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
collinc777 committed Aug 15, 2024
1 parent a5b4a77 commit e6a1c45
Show file tree
Hide file tree
Showing 8 changed files with 682 additions and 1,420 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
lint-and-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- run: npm ci
- name: Check linting
run: npm run lint
- name: Check formatting
run: npx prettier --check 'src/**/*.{js,ts,tsx}'

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- run: npm ci
- run: npm run compile
- run: npm test
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"singleQuote": true,
"trailingComma": "es5",
"tabWidth": 2,
"semi": true,
"printWidth": 100
}
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,22 @@ MIT
If you encounter any problems or have any suggestions, please open an issue on the [GitHub repository](https://github.com/collinc777/context-copy).
## Development
This project uses ESLint and Prettier for code linting and formatting. These checks are run in the CI pipeline for all pull requests.
To manually run linting:
```bash
npm run lint
```

To manually run formatting:

```bash
npm run format
```

---

Happy coding, and enjoy using Copy for Context!
Loading

0 comments on commit e6a1c45

Please sign in to comment.