Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

245
Views
es-lint error can ot be disabled in react

I had an eslint error when I try to commit the branch

147:14  error    Expected an assignment or function call and instead saw an expression
@typescript-eslint/no-unused-expressions

I can not find the problem in the code, also I tried to add

// eslint-disable-next-line no-unused-expressions

or

/* eslint-disable no-unused-expressions */

But still got the same error

 useEffect(() => {
    const setFile:any = []
    const addedFiles:any = acceptedFiles && acceptedFiles.map((item:File) => {
      if(item !== null){
        return {
          title: item?.name as string,
          fileName: item?.name as string,
          mediaType: 'SO',
          compositionType: 'O',
          album: ''
        };
      }else {[]}
    });
    setFile.push(addedFiles)
    if(addedFiles){ // **** the line 147
      setFileList([...addedFiles, ...fileList])
    }
    acceptedFiles && acceptedFiles.map((item:File) => {
      onUpload({
      title: item?.name as string,
      fileName: item?.name as string,
      mediaType: 'SO',
      compositionType: 'O',
      album: ''
    });
    })
  }, [acceptedFiles]);

  return (...
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You forgot to prefix the rule name with @typescript-eslint/.

To disable that rule inline use:

// eslint-disable-next-line @typescript-eslint/no-unused-expressions

Alternatively, in your .eslintrc file, disable the rule with the setting

"@typescript-eslint/no-unused-expressions": "off"
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!