diff --git a/.eslintrc.cjs b/.eslintrc.cjs new file mode 100644 index 0000000..b5358f0 --- /dev/null +++ b/.eslintrc.cjs @@ -0,0 +1,12 @@ +module.exports = { + root: true, + env: { + browser: true, + node: true + }, + extends: [ + 'digitalbazaar', + 'digitalbazaar/jsdoc' + ], + ignorePatterns: ['dist/'] +}; diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml new file mode 100644 index 0000000..3cc6e45 --- /dev/null +++ b/.github/workflows/main.yaml @@ -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 diff --git a/index.js b/index.js index d942926..9d15cd0 100644 --- a/index.js +++ b/index.js @@ -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.'); } } diff --git a/package.json b/package.json index 0e77377..e897e8b 100644 --- a/package.json +++ b/package.json @@ -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" }, @@ -39,6 +42,7 @@ ], "scripts": { "prepublish": "npm run build", - "build": "webpack --mode development" + "build": "webpack --mode development", + "lint": "eslint --ext .cjs,.js ." } }