Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP feat: add support for importing as esm #711

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
206 changes: 0 additions & 206 deletions .eslintrc.js

This file was deleted.

4 changes: 3 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ jobs:
- name: Lint
run: npm run lint
- name: Test
run: npm test
run: npm run test:ci
env:
DYNAMO_ENDPOINT: http://localhost:8000
- name: Test ESM
run: npm run test:esm
- name: Publish
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
# npm will not execute `prepublisnOnly` lifecycle hook if user is root.
Expand Down
23 changes: 0 additions & 23 deletions .vscode/launch.json

This file was deleted.

4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"editor.codeActionsOnSave": {
"source.organizeImports": "never",
"source.fixAll.eslint": "explicit"
},
"cSpell.words": [
"dyngoose"
]
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3"

services:
dynamodb:
image: amazon/dynamodb-local
Expand Down
56 changes: 56 additions & 0 deletions eslint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
const love = require('eslint-config-love')
const simpleImportSort = require('eslint-plugin-simple-import-sort')
const importPlugin = require('eslint-plugin-import')

module.exports = [
{
...love,
files: ['**/*.js', '**/*.ts'],
plugins: {
...love.plugins ?? {},
'simple-import-sort': simpleImportSort,
'import': importPlugin,
},
rules: {
...love.rules,
// disable the eslint rule as it can report incorrectly
// 'space-before-function-paren': 'off',

// sort imports!
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
"import/first": "error",
"import/newline-after-import": "error",
"import/no-duplicates": "error",

// we use a few labeled for loops
'no-labels': 'off',

'@typescript-eslint/no-non-null-assertion': 'off',

// we want to use strict === false to avoid truthy logic
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'off',

// uninitialized variables are assumed as undefined
'@typescript-eslint/init-declarations': 'off',

// we use any
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',

// we use delete
'@typescript-eslint/no-dynamic-delete': 'off',

// attribute classes do not all use this in toDynamo, fromDynamo, toJSON, etc
'@typescript-eslint/class-methods-use-this': 'off',

// allow throwing of caught errors (unknowns)
'@typescript-eslint/only-throw-error': ['error', {
allowThrowingUnknown: true,
}],

// we need to rely on require at times
'@typescript-eslint/no-require-imports': 'off',
}
}
]
Loading
Loading