diff --git a/.eslintignore b/.eslintignore
index f16fd853..3250d3e9 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -3,5 +3,11 @@ vite.config.ts
.eslintrc.cjs
node_modules
dist
-storybook-static
-*.md
\ No newline at end of file
+*.md
+site
+apps/next-12
+.yarnrc.yml
+.eslintrc.*js
+*.config.*js
+eslint-config-sistent
+apps/design-system
\ No newline at end of file
diff --git a/.eslintrc.js b/.eslintrc.js
new file mode 100644
index 00000000..4ea18edb
--- /dev/null
+++ b/.eslintrc.js
@@ -0,0 +1,25 @@
+module.exports = {
+ root: true,
+ env: {
+ browser: true,
+ es6: true
+ },
+ extends: [
+ 'eslint:recommended',
+ 'plugin:@typescript-eslint/recommended',
+ 'plugin:react-hooks/recommended',
+ 'plugin:storybook/recommended'
+ ],
+ plugins: ['react'],
+ parser: '@typescript-eslint/parser',
+ parserOptions: {
+ ecmaVersion: 'latest',
+ sourceType: 'module',
+ requireConfigFile: false
+ },
+ settings: {
+ react: {
+ version: 'detect'
+ }
+ }
+};
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 9f67c83c..ec3eb61c 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -1,28 +1,31 @@
-name: Linting and formatting
+name: Lint check
on:
- push:
- branches:
- - "*"
- pull_request:
- branches:
- - "*"
+ push:
+ branches:
+ - '*'
+ pull_request:
+ branches:
+ - '*'
jobs:
- lint:
- runs-on: ubuntu-latest
-
- steps:
- - name: Checkout code
- uses: actions/checkout@v4.1.1
+ lint:
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ node-version: [16, 18, 20]
- - name: Set up Node.js ${{ matrix.node-version }}
- uses: actions/setup-node@v4.0.0
- with:
- node-version: ${{ matrix.node-version }}
-
- - name: Install dependencies
- run: yarn install
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
- - name: Run Lint
- run: yarn lint && yarn format:check && yarn lint-staged
+ - name: Set up Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@v4
+ with:
+ node-version: ${{ matrix.node-version }}
+
+ - name: Install dependencies
+ run: yarn install
+
+ - name: Run Lint
+ run: yarn lint
diff --git a/.gitignore b/.gitignore
index f6b5168f..0e79de99 100644
--- a/.gitignore
+++ b/.gitignore
@@ -36,3 +36,4 @@ packages/design-system/node_modules/**
**/storybook-static/**
lerna-debug.log
pub.sh
+.eslintcache
\ No newline at end of file
diff --git a/.prettierignore b/.prettierignore
index e81dc30e..3ada852b 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -1,4 +1,9 @@
# Ignore artifacts:
**/dist/**
**/coverage/**
-**/.cache/**
\ No newline at end of file
+**/.cache/**
+**/.github/**
+**/.yarn/**
+site/public
+.yarnrc.yml
+.eslintrc.*js
\ No newline at end of file
diff --git a/apps/next-12/.eslintrc.json b/apps/next-12/.eslintrc.json
deleted file mode 100644
index bffb357a..00000000
--- a/apps/next-12/.eslintrc.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "extends": "next/core-web-vitals"
-}
diff --git a/apps/next-12/components/DefaultModal/index.jsx b/apps/next-12/components/DefaultModal/index.jsx
index ebc12306..ce37b606 100644
--- a/apps/next-12/components/DefaultModal/index.jsx
+++ b/apps/next-12/components/DefaultModal/index.jsx
@@ -1,57 +1,56 @@
import {
- Button,
- Dialog,
- DialogActions,
- DialogContent,
- DialogTitle,
- IconButton,
- Typography
- } from '@layer5/sistent-components';
- import { CloseIcon } from '@layer5/sistent-svg';
- import React from 'react';
-
- export default function DefaultModal() {
- const [open, setOpen] = React.useState(false);
-
- const handleClickOpen = () => {
- setOpen(true);
- };
- const handleClose = () => {
- setOpen(false);
- };
-
- return (
-
-
-
-
- );
- }
-
\ No newline at end of file
+ Button,
+ Dialog,
+ DialogActions,
+ DialogContent,
+ DialogTitle,
+ IconButton,
+ Typography
+} from '@layer5/sistent-components';
+import { CloseIcon } from '@layer5/sistent-svg';
+import React from 'react';
+
+export default function DefaultModal() {
+ const [open, setOpen] = React.useState(false);
+
+ const handleClickOpen = () => {
+ setOpen(true);
+ };
+ const handleClose = () => {
+ setOpen(false);
+ };
+
+ return (
+
+
+
+
+ );
+}
diff --git a/apps/next-12/components/ModeToggleButton.jsx b/apps/next-12/components/ModeToggleButton.jsx
index f8013102..d1bfcc28 100644
--- a/apps/next-12/components/ModeToggleButton.jsx
+++ b/apps/next-12/components/ModeToggleButton.jsx
@@ -1,6 +1,6 @@
+import { toggleTheme } from '@/lib/redux/theme/themeSlice';
import { IconButton } from '@mui/material';
import { useDispatch, useSelector } from 'react-redux';
-import { toggleTheme } from '@/lib/redux/theme/themeSlice';
import DarkModeIcon from '@mui/icons-material/DarkMode';
import LightModeIcon from '@mui/icons-material/LightMode';
@@ -17,7 +17,7 @@ function ModeToggleButton() {
const dispatch = useDispatch(); // Initialize the useDispatch function
// Use useSelector to get the darkTheme state from your Redux store
- const mode = useSelector((state) => state.theme.darkTheme ? 'dark' : 'light');
+ const mode = useSelector((state) => (state.theme.darkTheme ? 'dark' : 'light'));
const toggleMode = () => {
// Dispatch the toggleTheme action when the button is clicked
diff --git a/apps/next-12/components/ResponsiveDataTable/ResponsiveDataTable.jsx b/apps/next-12/components/ResponsiveDataTable/ResponsiveDataTable.jsx
index 04cbb3ba..e5e5d66b 100644
--- a/apps/next-12/components/ResponsiveDataTable/ResponsiveDataTable.jsx
+++ b/apps/next-12/components/ResponsiveDataTable/ResponsiveDataTable.jsx
@@ -1,12 +1,7 @@
import MUIDataTable from 'mui-datatables';
import { useEffect, useState } from 'react';
-export function ResponsiveDataTable({
- data,
- columns,
- options = {},
- ...props
-}) {
+export function ResponsiveDataTable({ data, columns, options = {}, ...props }) {
const [tableCols, updateCols] = useState(columns);
const [columnVisibility, ,] = useState({});
@@ -15,7 +10,7 @@ export function ResponsiveDataTable({
weekday: 'short',
day: 'numeric',
month: 'long',
- year: 'numeric',
+ year: 'numeric'
};
return new Intl.DateTimeFormat('un-US', dateOptions).format(date);
@@ -42,7 +37,7 @@ export function ResponsiveDataTable({
break;
}
}
- },
+ }
};
useEffect(() => {
@@ -81,7 +76,7 @@ export function ResponsiveDataTable({
}, [columnVisibility]);
const components = {
- ExpandButton: () => '',
+ ExpandButton: () => ''
};
return (
diff --git a/apps/next-12/components/ResponsiveDataTable/index.jsx b/apps/next-12/components/ResponsiveDataTable/index.jsx
index f5131f60..5768cd60 100644
--- a/apps/next-12/components/ResponsiveDataTable/index.jsx
+++ b/apps/next-12/components/ResponsiveDataTable/index.jsx
@@ -1 +1 @@
-export { ResponsiveDataTable } from "./ResponsiveDataTable";
\ No newline at end of file
+export { ResponsiveDataTable } from './ResponsiveDataTable';
diff --git a/apps/next-12/components/SistentModal/index.jsx b/apps/next-12/components/SistentModal/index.jsx
index 34b2bd92..1d63c4be 100644
--- a/apps/next-12/components/SistentModal/index.jsx
+++ b/apps/next-12/components/SistentModal/index.jsx
@@ -17,7 +17,9 @@ export default function SistentModal() {
};
return (
-
+
);
-}
\ No newline at end of file
+}
diff --git a/apps/next-12/components/index.jsx b/apps/next-12/components/index.jsx
index dee1aaa3..fc849388 100644
--- a/apps/next-12/components/index.jsx
+++ b/apps/next-12/components/index.jsx
@@ -1 +1 @@
-export * from './ResponsiveDataTable';
\ No newline at end of file
+export * from './ResponsiveDataTable';
diff --git a/apps/next-12/lib/providers/AppThemeProvider.jsx b/apps/next-12/lib/providers/AppThemeProvider.jsx
index e9a15925..63bd6746 100644
--- a/apps/next-12/lib/providers/AppThemeProvider.jsx
+++ b/apps/next-12/lib/providers/AppThemeProvider.jsx
@@ -1,45 +1,45 @@
-import { useSelector, useDispatch } from "react-redux";
-import createEmotionCache from "@/styles/createEmotionCache";
+import createEmotionCache from '@/styles/createEmotionCache';
+import { darkTheme, lightTheme } from '@/styles/themes/theme';
import { CacheProvider } from '@emotion/react';
import { CssBaseline, ThemeProvider, createTheme } from '@mui/material';
-import { darkTheme, lightTheme } from "@/styles/themes/theme";
-import { useMemo } from "react";
+import { useMemo } from 'react';
+import { useSelector } from 'react-redux';
const clientSideEmotionCache = createEmotionCache();
export function AppThemeProvider({ children, emotionCache = clientSideEmotionCache }) {
- // const dispatch = useDispatch();
+ // const dispatch = useDispatch();
- const mode = useSelector((state) => state.theme.darkTheme ? "dark" : "light")
+ const mode = useSelector((state) => (state.theme.darkTheme ? 'dark' : 'light'));
- const theme = useMemo(
- () =>
- createTheme({
- palette: {
- mode,
- primary: {
- ...(mode === 'light' ? lightTheme.palette.primary : darkTheme.palette.primary),
- },
- secondary: {
- main: '#EE5351',
- },
- background: {
- ...(mode === 'light' ? lightTheme.palette.background : darkTheme.palette.background),
- },
- text: {
- ...(mode === 'light' ? lightTheme.palette.text : darkTheme.palette.text),
- },
- },
- }),
- [mode],
- );
+ const theme = useMemo(
+ () =>
+ createTheme({
+ palette: {
+ mode,
+ primary: {
+ ...(mode === 'light' ? lightTheme.palette.primary : darkTheme.palette.primary)
+ },
+ secondary: {
+ main: '#EE5351'
+ },
+ background: {
+ ...(mode === 'light' ? lightTheme.palette.background : darkTheme.palette.background)
+ },
+ text: {
+ ...(mode === 'light' ? lightTheme.palette.text : darkTheme.palette.text)
+ }
+ }
+ }),
+ [mode]
+ );
- return (
-
-
-
- {children}
-
-
- );
-}
\ No newline at end of file
+ return (
+
+
+
+ {children}
+
+
+ );
+}
diff --git a/apps/next-12/lib/providers/ReduxProvider.jsx b/apps/next-12/lib/providers/ReduxProvider.jsx
index 24f794df..4c87ff88 100644
--- a/apps/next-12/lib/providers/ReduxProvider.jsx
+++ b/apps/next-12/lib/providers/ReduxProvider.jsx
@@ -1,8 +1,6 @@
-import { Provider } from "react-redux";
-import store from "../redux/store";
+import { Provider } from 'react-redux';
+import store from '../redux/store';
export function ReduxProvider({ children }) {
- return (
- {children}
- )
-}
\ No newline at end of file
+ return {children};
+}
diff --git a/apps/next-12/lib/redux/store.js b/apps/next-12/lib/redux/store.js
index 28771503..a90e4924 100644
--- a/apps/next-12/lib/redux/store.js
+++ b/apps/next-12/lib/redux/store.js
@@ -1,8 +1,8 @@
-import { configureStore } from "@reduxjs/toolkit";
-import theme from "./theme/themeSlice";
+import { configureStore } from '@reduxjs/toolkit';
+import theme from './theme/themeSlice';
export default configureStore({
- reducer: {
- theme,
- },
-});
\ No newline at end of file
+ reducer: {
+ theme
+ }
+});
diff --git a/apps/next-12/lib/redux/theme/themeSlice.js b/apps/next-12/lib/redux/theme/themeSlice.js
index 6edfc1bb..ddb0c17d 100644
--- a/apps/next-12/lib/redux/theme/themeSlice.js
+++ b/apps/next-12/lib/redux/theme/themeSlice.js
@@ -1,17 +1,17 @@
-import { createSlice } from "@reduxjs/toolkit";
+import { createSlice } from '@reduxjs/toolkit';
export const themeSlice = createSlice({
- name: "theme",
- initialState: {
- darkTheme: false,
- },
- reducers: {
- toggleTheme: (state) => {
- state.darkTheme = !state.darkTheme;
- },
- },
+ name: 'theme',
+ initialState: {
+ darkTheme: false
+ },
+ reducers: {
+ toggleTheme: (state) => {
+ state.darkTheme = !state.darkTheme;
+ }
+ }
});
export const { toggleTheme } = themeSlice.actions;
-export default themeSlice.reducer;
\ No newline at end of file
+export default themeSlice.reducer;
diff --git a/apps/next-12/next.config.js b/apps/next-12/next.config.js
index a843cbee..6d32668b 100644
--- a/apps/next-12/next.config.js
+++ b/apps/next-12/next.config.js
@@ -1,6 +1,6 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
- reactStrictMode: true,
-}
+ reactStrictMode: true
+};
-module.exports = nextConfig
+module.exports = nextConfig;
diff --git a/apps/next-12/package.json b/apps/next-12/package.json
index 65c219d7..1b58a626 100644
--- a/apps/next-12/package.json
+++ b/apps/next-12/package.json
@@ -24,8 +24,7 @@
"react-redux": "^8.1.3"
},
"devDependencies": {
- "eslint": "^8",
- "eslint-config-next": "12"
+ "eslint": "^8"
},
"installConfig": {
"hoistingLimits": "workspaces"
diff --git a/apps/next-12/pages/_app.js b/apps/next-12/pages/_app.js
index 305a0b52..68ae8c08 100644
--- a/apps/next-12/pages/_app.js
+++ b/apps/next-12/pages/_app.js
@@ -1,5 +1,5 @@
-import { AppThemeProvider } from '@/lib/providers/AppThemeProvider'
-import { ReduxProvider } from '@/lib/providers/ReduxProvider'
+import { AppThemeProvider } from '@/lib/providers/AppThemeProvider';
+import { ReduxProvider } from '@/lib/providers/ReduxProvider';
export default function App({ Component, pageProps }) {
return (
@@ -8,5 +8,5 @@ export default function App({ Component, pageProps }) {
- )
+ );
}
diff --git a/apps/next-12/pages/_document.js b/apps/next-12/pages/_document.js
index 54e8bf3e..af2f1aba 100644
--- a/apps/next-12/pages/_document.js
+++ b/apps/next-12/pages/_document.js
@@ -1,4 +1,4 @@
-import { Html, Head, Main, NextScript } from 'next/document'
+import { Head, Html, Main, NextScript } from 'next/document';
export default function Document() {
return (
@@ -9,5 +9,5 @@ export default function Document() {