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

feat: Use ESM modules #35

Merged
merged 1 commit into from
Jan 17, 2024
Merged
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
7 changes: 7 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/tests/**/*.js
!/**/.eslintrc.js
/scripts/release/node_modules
/coverage/
/dist/
**/node_modules/**
node_modules/*
23 changes: 23 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module.exports = {
env: {
es2021: true,
node: true,
jest: true
},
parserOptions: {
ecmaVersion: 12,
sourceType: 'module'
},
extends: ['eslint:recommended', 'airbnb-base', 'prettier'],
plugins: ['prettier'],
rules: {
'import/extensions': [0, 'ignorePackages', { js: 'never', jsx: 'never' }],
'max-len': 0,
'no-console': 0,
'no-await-in-loop': 0,
'no-multiple-empty-lines': 0,
'space-in-parens': 0,
'no-spaced-func': 0
}
};

2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 20
- run: yarn && yarn test
- run: npm install && npm test
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dist
dist-types
coverage
.vscode
yarn.lock
package-lock.json
8 changes: 8 additions & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
semi: true
trailingComma: none
singleQuote: true
tabWidth: 2
useTabs: false
bracketSpacing: true
insertFinalNewline: true
printWidth: 120
2 changes: 1 addition & 1 deletion __mocks__/import-from.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = (path, module) => require(module);
export default (path, module) => import(module);
2 changes: 1 addition & 1 deletion __mocks__/myPlugin.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = 'myPlugin';
export default 'myPlugin';
13 changes: 13 additions & 0 deletions babel.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// babel.config.js
module.exports = {
presets: [
[
'@babel/preset-env',
{
targets: {
node: 'current'
}
}
]
]
};
5 changes: 5 additions & 0 deletions jest.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
transform: {
'\\.[jt]sx?$': 'babel-jest'
}
};
Loading