Skip to content

Commit

Permalink
Fixed ESLint bugs that required ts-specific rules for js functions
Browse files Browse the repository at this point in the history
  • Loading branch information
yugal07 committed Jan 9, 2025
1 parent b72d43f commit 9a7f11a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/githooks/check-localstorage-usage.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { execSync } from 'child_process';
const args = process.argv.slice(2);
const scanEntireRepo = args.includes('--scan-entire-repo');

// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
const containsSkipComment = (file) => {
try {
const content = readFileSync(file, 'utf-8');
Expand All @@ -17,6 +18,7 @@ const containsSkipComment = (file) => {
}
};

// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
const getModifiedFiles = () => {
try {
if (scanEntireRepo) {
Expand All @@ -40,6 +42,7 @@ const files = getModifiedFiles();

const filesWithLocalStorage = [];

// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
const checkLocalStorageUsage = (file) => {
if (!file) {
return;
Expand Down Expand Up @@ -86,10 +89,10 @@ if (filesWithLocalStorage.length > 0) {

console.info(
'\x1b[34m%s\x1b[0m',
'\nInfo: Consider using custom hook functions.'
'\nInfo: Consider using custom hook functions.',
);
console.info(
'Please use the getItem, setItem, and removeItem functions provided by the custom hook useLocalStorage.\n'
'Please use the getItem, setItem, and removeItem functions provided by the custom hook useLocalStorage.\n',
);

process.exit(1);
Expand Down

0 comments on commit 9a7f11a

Please sign in to comment.