Jelajahi Sumber

add .eslintrc.js and fix lint error

Yuki Takei 3 tahun lalu
induk
melakukan
4201e02741

+ 18 - 0
packages/plugin-lsx/.eslintrc.js

@@ -0,0 +1,18 @@
+module.exports = {
+  extends: [
+    'weseek/react',
+    'weseek/typescript',
+  ],
+  env: {
+  },
+  globals: {
+  },
+  settings: {
+    // resolve path aliases by eslint-import-resolver-typescript
+    'import/resolver': {
+      typescript: {},
+    },
+  },
+  rules: {
+  },
+};

+ 2 - 4
packages/plugin-lsx/src/components/Lsx.tsx

@@ -75,8 +75,6 @@ function generatePageNode(pathToNodeMap: Record<string, PageNode>, rootPagePath:
 
 
 
 
 type Props = {
 type Props = {
-  // lsxContext: PropTypes.instanceOf(LsxContext).isRequired,
-
   children: React.ReactNode,
   children: React.ReactNode,
   className?: string,
   className?: string,
 
 
@@ -179,7 +177,7 @@ export const Lsx = ({
 
 
     let newNodeTree: PageNode[] = [];
     let newNodeTree: PageNode[] = [];
     try {
     try {
-      const result: any = await axios.get('/_api/plugins/lsx', {
+      const result = await axios.get('/_api/plugins/lsx', {
         params: {
         params: {
           pagePath,
           pagePath,
           options: lsxContext.options,
           options: lsxContext.options,
@@ -212,7 +210,7 @@ export const Lsx = ({
     finally {
     finally {
       setLoading(false);
       setLoading(false);
     }
     }
-  }, [basisViewersCount, generatePageNodeTree, isCacheExists, lsxContext]);
+  }, [basisViewersCount, generatePageNodeTree, lsxContext]);
 
 
   useEffect(() => {
   useEffect(() => {
     // get state object cache
     // get state object cache