Skip to content

Commit

Permalink
@uppy/audio: refactor to ESM
Browse files Browse the repository at this point in the history
npm package is still CommonJS, the plan is to switch that in the
next semver-major.
  • Loading branch information
aduh95 committed Feb 7, 2022
1 parent 0fcb722 commit 9953371
Show file tree
Hide file tree
Showing 17 changed files with 439 additions and 392 deletions.
37 changes: 37 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,43 @@ module.exports = {
},
},
},
{
files: [
// Packages that have switched to ESM sources:
'packages/@uppy/audio/src/**/*.js',
],
parserOptions: {
sourceType: 'module',
ecmaFeatures: {
jsx: false,
},
},
rules: {
'no-restricted-globals': [
'error',
{
name: '__filename',
message: 'Use import.meta.url instead',
},
{
name: '__dirname',
message: 'Not available in ESM',
},
{
name: 'exports',
message: 'Not available in ESM',
},
{
name: 'module',
message: 'Not available in ESM',
},
{
name: 'require',
message: 'Use import instead',
},
],
},
},
{
files: ['./packages/@uppy/companion/**/*.js'],
rules: {
Expand Down
1 change: 1 addition & 0 deletions packages/@uppy/audio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"record",
"mediarecorder"
],
"type": "module",
"homepage": "https://uppy.io",
"bugs": {
"url": "https://github.com/transloadit/uppy/issues"
Expand Down
Loading

0 comments on commit 9953371

Please sign in to comment.