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

fix rollup and eslint configuration #9

Merged
merged 1 commit into from
Oct 7, 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
2 changes: 1 addition & 1 deletion dist/smartbear-browser-info.embed.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/smartbear-browser-info.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import globals from "globals";
import js from "@eslint/js";
import babel from "@babel/eslint-parser";

export default [
{
Expand All @@ -10,7 +11,16 @@ export default [
languageOptions: {
globals: globals.browser,
ecmaVersion: 2020,
sourceType: "module"
sourceType: "module",
parser: babel,
parserOptions: {
requireConfigFile: false,
babelOptions: {
plugins: [
"@babel/plugin-syntax-import-assertions"
]
}
},
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import del from 'rollup-plugin-delete';
import terser from '@rollup/plugin-terser';

import $package from './package.json';
import $package from './package.json' with { type: 'json' };

const input = 'src/index.js';
const external = Object.keys($package.dependencies || []);
Expand Down
6 changes: 1 addition & 5 deletions test/test.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import { expect } from 'chai';
import BrowserInfo from '../src/index.js';
import data from './data.json' with { type: "json" };

// import data from './data.json' with { type: "json" };
// - returns "ExperimentalWarning: Importing JSON modules"
// so we use createRequire to import the json file as a workaround
import { createRequire } from "module";
const data = createRequire(import.meta.url)("./data.json");

describe('Test known combinations', () => {

Expand Down
Loading