Skip to content

Commit

Permalink
Merge pull request #9 from piotrsapiejewskismartbear/master
Browse files Browse the repository at this point in the history
fix rollup and eslint configuration
  • Loading branch information
marisuch authored Oct 7, 2024
2 parents 90442d9 + 63f62e9 commit 7efe979
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
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

0 comments on commit 7efe979

Please sign in to comment.