diff --git a/.eslintrc.js b/.eslintrc.js index 6531783903..b6dcece1e8 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -447,8 +447,11 @@ module.exports = { rules: { 'no-extra-semi': 'off', 'no-restricted-syntax': ['error', { - selector: 'ImportDeclaration[importKind="type"][source.value=/^(\\.+|@uppy\\x2F[a-z-0-9]+)\\x2F/]:not([source.value=/^@uppy\\x2Futils\\x2F/]):not([source.value=/\\.js$/])', - message: 'Use ".js" file extension for import type declarations', + selector: 'ImportDeclaration[importKind="type"][source.value=/^@uppy\\x2F[a-z-0-9]+\\x2F/]:not([source.value=/^@uppy\\x2Futils\\x2F/]):not([source.value=/\\.js$/])', + message: 'Use ".js" file extension for import type declarations from a different package', + }, { + selector: 'ImportDeclaration[importKind="type"][source.value=/^\\.\\.?\\x2F.+\\.js$/]', + message: 'Do not use ".js" file extension for relative import type declarations', }, { selector: 'ImportDeclaration[source.value=/^@uppy\\x2Futils\\x2Flib\\x2F.+\\.[mc]?[jt]sx?$/]', message: 'Do not use file extension when importing from @uppy/utils', @@ -497,6 +500,14 @@ module.exports = { 'no-unused-vars': 'off', }, }, + { + files: [ + 'packages/@uppy/svelte/**', + ], + parserOptions: { + sourceType: 'module', + }, + }, { files: ['e2e/**/*.ts'], extends: ['plugin:cypress/recommended'], diff --git a/.github/workflows/bundlers.yml b/.github/workflows/bundlers.yml index 7f186ac5ba..8f96efd6de 100644 --- a/.github/workflows/bundlers.yml +++ b/.github/workflows/bundlers.yml @@ -105,7 +105,7 @@ jobs: } from "@rollup/plugin-node-resolve"; export default { - input: "./index.mjs", + input: "./lib/index.js", output: { file: "/dev/null", }, @@ -137,9 +137,9 @@ jobs: - run: npx webpack --version - name: Create Webpack config file run: - echo - 'module.exports={mode:"production",target:"web",entry:"./index.mjs"}' - > webpack.config.js + echo 'export default + {mode:"production",target:"web",entry:"./lib/index.js"}' > + webpack.config.js - name: Bundle run: npx webpack @@ -171,7 +171,7 @@ jobs: run: npm i --save-dev parcel@${{matrix.bundler-version}} - run: npx parcel --version - name: Bundle - run: npx parcel build index.mjs + run: npx parcel build lib/index.js vite: needs: isolate_uppy @@ -194,7 +194,7 @@ jobs: - name: Create index.html run: echo '
' > index.html + src="./lib/index.js">