Skip to content

Commit

Permalink
Merge pull request #12 from aloisklink/fix-esm-imports
Browse files Browse the repository at this point in the history
Add a basic `eslint` linter config, and fixes some bugs that it caught
  • Loading branch information
tbo47 authored Dec 14, 2022
2 parents 62844ae + d1475ad commit 46313db
Show file tree
Hide file tree
Showing 60 changed files with 2,111 additions and 188 deletions.
24 changes: 24 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
module.exports = {
env: {
browser: true,
es6: true, // todo, increase this es2016 or later to use new Javascript features
node: true,
},
extends: ['eslint:recommended', 'plugin:import/recommended'],
overrides: [],
parserOptions: {
sourceType: 'module',
},
rules: {
// make sure that all files have an extension (required by ESM)
'import/extensions': [
'error',
'always',
{
js: 'always',
jsx: 'never',
mjs: 'always',
},
],
},
};
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,7 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci # throws an error if the package-lock.json file is out of sync
- name: Check for linting errors (run `npm run lint:fix` to fix)
run: npm run lint
- name: Check for prettier errors (run `npm run format` to fix)
run: npx prettier --check .
Loading

0 comments on commit 46313db

Please sign in to comment.