Skip to content

Commit

Permalink
chore: resolve eslint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
nicomiguelino committed Dec 4, 2024
1 parent d894141 commit 4e749ba
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 25 deletions.
41 changes: 22 additions & 19 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import jasmine from "eslint-plugin-jasmine";
import globals from "globals";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";
import jasmine from 'eslint-plugin-jasmine';
import globals from 'globals';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
Expand All @@ -15,25 +15,26 @@ const compat = new FlatCompat({

export default [
...compat.extends(
"eslint:recommended",
"plugin:react/recommended",
"plugin:jasmine/recommended"
'eslint:recommended',
'plugin:react/recommended',
'plugin:jasmine/recommended'
),
{
ignores: [
"src/lib/vendor/",
"node_modules/",
"dist/",
]
'src/lib/vendor/',
'node_modules/',
'dist/',
],
},
{
files: ['**/*.{js,jsx,mjs}'],
plugins: {
jasmine,
},

settings: {
react: {
version: "detect",
version: 'detect',
},
},

Expand All @@ -42,12 +43,12 @@ export default [
...globals.browser,
...globals.jasmine,
...globals.node,
Atomics: "readonly",
SharedArrayBuffer: "readonly",
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},

ecmaVersion: "latest",
sourceType: "module",
ecmaVersion: 'latest',
sourceType: 'module',

parserOptions: {
ecmaFeatures: {
Expand All @@ -56,6 +57,8 @@ export default [
},
},

rules: {},
rules: {
'react/prop-types': 'off',
},
}
];
4 changes: 3 additions & 1 deletion src/assets/js/components/options/authenticated-options.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* global browser */

import React from 'react';
import { useDispatch } from 'react-redux';
import { useState } from 'react';
Expand All @@ -14,7 +16,7 @@ export const AuthenticatedOptionsView = () => {

try {
await browser.storage.sync.clear();
} catch (error) {
} catch {
return;
} finally {
setIsLoading(false);
Expand Down
4 changes: 3 additions & 1 deletion src/assets/js/components/options/sign-in.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* global browser */

import React from 'react';
import { useState } from 'react';
import { useDispatch } from 'react-redux';
Expand Down Expand Up @@ -43,7 +45,7 @@ export const SignInForm = () => {

setShowSignInFormError(false);
dispatch(signIn());
} catch (error) {
} catch {
setShowSignInFormError(true);
} finally {
setIsLoading(false);
Expand Down
1 change: 1 addition & 0 deletions src/assets/js/components/options/token-help-text.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const TokenHelpText = () => {
<a
href="https://support.screenly.io/hc/en-us/articles/35897560148371-How-to-Generate-a-Screenly-API-Token"
target="_blank"
rel="noreferrer"
>this page</a>&nbsp;for details.
</p>
</div>
Expand Down
6 changes: 4 additions & 2 deletions src/assets/js/components/popup/proposal.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* global browser */

import React from 'react';
import { useEffect, useState } from 'react';
import { useDispatch } from 'react-redux';
Expand All @@ -20,7 +22,7 @@ import {
setShowSuccess,
} from '@/features/popup/popupSlice';

export const Proposal = (props) => {
export const Proposal = () => {
const dispatch = useDispatch();
const [isLoading, setIsLoading] = useState(false);
const [assetTitle, setAssetTitle] = useState('');
Expand Down Expand Up @@ -161,7 +163,7 @@ export const Proposal = (props) => {
}

await proposeToAddToScreenly(user, pageUrl, pageTitle, cookieJar);
} catch (error) {
} catch {
window.close();
}
};
Expand Down
4 changes: 3 additions & 1 deletion src/assets/js/components/popup/sign-in.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
/* global browser */

import React from 'react';

export const SignInCallToAction = () => {
const handleSignIn = (event) => {
const handleSignIn = () => {
browser.runtime.openOptionsPage();
};

Expand Down
1 change: 0 additions & 1 deletion src/assets/js/components/popup/success.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';
import { useSelector } from 'react-redux';

export const Success = ({ assetDashboardLink }) => {
const openAssetDashboard = () => {
Expand Down

0 comments on commit 4e749ba

Please sign in to comment.