Skip to content

Commit

Permalink
Add eslint and prettier to code base (#26)
Browse files Browse the repository at this point in the history
* eslint cleanup

* remove node-fetch

* prettier fix

* Add type to imports
  • Loading branch information
cbrianball authored Dec 30, 2023
1 parent 8dc827f commit 90e1114
Show file tree
Hide file tree
Showing 40 changed files with 4,546 additions and 1,623 deletions.
10 changes: 10 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* eslint-env node */
module.exports = {
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
root: true,
rules: {
'@typescript-eslint/consistent-type-imports': 'error',
}
};
27 changes: 14 additions & 13 deletions .github/workflows/action-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ name: CI
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -22,14 +22,15 @@ jobs:

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: 'lts/Hydrogen'
- run: npm ci
- run: npm run test-ci
- name: Report Coverage
uses: davelosert/vitest-coverage-report-action@v2
if: always()
- run: npm run build --if-present
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: "lts/Hydrogen"
- run: npm ci
- run: npm run lint
- run: npm run test-ci
- name: Report Coverage
uses: davelosert/vitest-coverage-report-action@v2
if: always()
- run: npm run build --if-present
7 changes: 4 additions & 3 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 'lts/Hydrogen'
node-version: "lts/Hydrogen"
- run: npm ci
- run: npm run lint
- run: npm test-ci
- name: report coverage
uses: davelosert/vitest-coverage-report-action@v2
Expand All @@ -28,10 +29,10 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 'lts/Hydrogen'
node-version: "lts/Hydrogen"
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm version "${GITHUB_REF#refs/tags/}" --no-git-tag-version
- run: npm run publish-npm
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": false,
"printWidth": 120
}
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"typescript.tsdk": "node_modules\\typescript\\lib"
"typescript.tsdk": "node_modules\\typescript\\lib",
"prettier.enable": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
Loading

0 comments on commit 90e1114

Please sign in to comment.