Skip to content

Commit

Permalink
use esm syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
Drew-Daniels committed Aug 4, 2024
1 parent b7ac55b commit a52375a
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 16 deletions.
1 change: 0 additions & 1 deletion apps/iframe-react-app/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@
"sourceRoot": "apps/iframe-react-app/src",
"projectType": "application",
"tags": [],
"// targets": "to see all targets run: nx show project iframe-react-app --web",
"targets": {}
}
1 change: 0 additions & 1 deletion apps/parent-react-app/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@
"sourceRoot": "apps/parent-react-app/src",
"projectType": "application",
"tags": [],
"// targets": "to see all targets run: nx show project parent-react-app --web",
"targets": {}
}
2 changes: 1 addition & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = [
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
rules: {
'@nx/enforce-module-boundaries': [
'error',
'warn',
{
enforceBuildableLibDependency: true,
allow: [],
Expand Down
13 changes: 9 additions & 4 deletions libs/core/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
const { FlatCompat } = require('@eslint/eslintrc');
const baseConfig = require('../../eslint.config.js');
const js = require('@eslint/js');
import { FlatCompat } from '@eslint/eslintrc';
import baseConfig from "../../eslint.config.js";
import js from "@eslint/js";
import path from 'path';
import { fileURLToPath } from 'url';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
});

module.exports = [
export default [
...baseConfig,
{
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
Expand Down
2 changes: 1 addition & 1 deletion libs/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"dependencies": {
"tslib": "^2.3.0"
},
"type": "commonjs",
"type": "module",
"main": "./src/index.js",
"typings": "./src/index.d.ts",
"private": true
Expand Down
2 changes: 0 additions & 2 deletions libs/core/src/lib/core.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { Parent, IFrame } from "./core";

describe('Parent', () => {
it.todo('should work');
});
Expand Down
13 changes: 9 additions & 4 deletions libs/react/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
const { FlatCompat } = require('@eslint/eslintrc');
const baseConfig = require('../../eslint.config.js');
const js = require('@eslint/js');
import { FlatCompat } from '@eslint/eslintrc';
import baseConfig from '../../eslint.config.js';
import js from '@eslint/js';
import path from 'path';
import { fileURLToPath } from 'url';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
});

module.exports = [
export default [
...baseConfig,
...compat.extends('plugin:@nx/react'),
{
Expand Down
1 change: 1 addition & 0 deletions libs/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.0.1",
"main": "./index.js",
"types": "./index.d.ts",
"type": "module",
"exports": {
".": {
"import": "./index.mjs",
Expand Down
2 changes: 0 additions & 2 deletions libs/react/src/lib/react.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { useIFrame, useParent } from "./react";

describe('useParent', () => {
it.todo('should work');
});
Expand Down

0 comments on commit a52375a

Please sign in to comment.