Skip to content

Commit

Permalink
Add lint support.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlehn committed Jun 13, 2024
1 parent 7544526 commit ec5295b
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 2 deletions.
12 changes: 12 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
root: true,
env: {
browser: true,
node: true
},
extends: [
'digitalbazaar',
'digitalbazaar/jsdoc'
],
ignorePatterns: ['dist/']
};
20 changes: 20 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Main CI

on: [push]

jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install
run: npm install
- name: Run eslint
run: npm run lint
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,6 @@ export async function load(options = {

function _assertSecureContext() {
if(!window.isSecureContext) {
throw new DOMException('SecurityError', 'The operation is insecure.')
throw new DOMException('SecurityError', 'The operation is insecure.');
}
}
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
]
},
"devDependencies": {
"eslint": "^8.57.0",
"eslint-config-digitalbazaar": "^5.2.0",
"eslint-plugin-jsdoc": "^48.2.11",
"webpack": "^4.10.2",
"webpack-cli": "^3.3.9"
},
Expand All @@ -39,6 +42,7 @@
],
"scripts": {
"prepublish": "npm run build",
"build": "webpack --mode development"
"build": "webpack --mode development",
"lint": "eslint --ext .cjs,.js ."
}
}

0 comments on commit ec5295b

Please sign in to comment.