GithubHelp home page GithubHelp logo

Error: The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received '' about prettier-eslint-cli HOT 4 CLOSED

alendra1945 avatar alendra1945 commented on June 10, 2024 7
Error: The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received ''

from prettier-eslint-cli.

Comments (4)

guimochila avatar guimochila commented on June 10, 2024 1

It was happened to me as well. I have removed prettier-eslint-cli and add prettier. It worked with prettier --write 'src/**/*.{ts,tsx}'

from prettier-eslint-cli.

ownchoice avatar ownchoice commented on June 10, 2024

Having the same problem with a Next.js project.

eslint and next lint both work just fine, but prettier-eslint (from prettier-eslint-cli) throws the error.

Error: Failed to load plugin '@typescript-eslint' declared in 'CLIOptions': The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received '' 
TypeError: Failed to load plugin '@typescript-eslint' declared in 'CLIOptions': The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received ''
    at new NodeError (node:internal/errors:371:5)
    at createRequire (node:internal/modules/cjs/loader:1277:13)
    at Object.resolve (d:\git\subfolder\project\web_prod\node_modules\@eslint\eslintrc\dist\eslintrc.cjs:2325:16)
    at Object.ModuleResolver.resolve (d:\git\subfolder\project\web_prod\node_modules\@rushstack\eslint-patch\lib\modern-module-resolution.js:201:44)
    at ConfigArrayFactory._loadPlugin (d:\git\subfolder\project\web_prod\node_modules\@eslint\eslintrc\dist\eslintrc.cjs:3376:33)
    at ConfigArrayFactory._loadPlugin (d:\git\subfolder\project\web_prod\node_modules\@rushstack\eslint-patch\lib\modern-module-resolution.js:203:43)
    at d:\git\subfolder\project\web_prod\node_modules\@eslint\eslintrc\dist\eslintrc.cjs:3267:33
    at Array.reduce (<anonymous>)
    at ConfigArrayFactory._loadPlugins (d:\git\subfolder\project\web_prod\node_modules\@eslint\eslintrc\dist\eslintrc.cjs:3263:22)
    at ConfigArrayFactory._normalizeObjectConfigDataBody (d:\git\subfolder\project\web_prod\node_modules\@eslint\eslintrc\dist\eslintrc.cjs:3063:44)
    at _normalizeObjectConfigDataBody.next (<anonymous>)
    at ConfigArrayFactory._normalizeObjectConfigData (d:\git\subfolder\project\web_prod\node_modules\@eslint\eslintrc\dist\eslintrc.cjs:3003:20)
    at _normalizeObjectConfigData.next (<anonymous>)
    at ConfigArrayFactory.create (d:\git\subfolder\project\web_prod\node_modules\@eslint\eslintrc\dist\eslintrc.cjs:2798:16)
    at createCLIConfigArray (d:\git\subfolder\project\web_prod\node_modules\@eslint\eslintrc\dist\eslintrc.cjs:3608:47)
    at CascadingConfigArrayFactory.clearCache (d:\git\subfolder\project\web_prod\node_modules\@eslint\eslintrc\dist\eslintrc.cjs:3780:32)
    at new ESLint (d:\git\subfolder\project\web_prod\node_modules\eslint\lib\eslint\eslint.js:448:32)
    at Pge (c:\Users\onlyme\.vscode\extensions\rvest.vs-code-prettier-eslint-5.0.1\dist\extension.js:180:69)
    at c:\Users\onlyme\.vscode\extensions\rvest.vs-code-prettier-eslint-5.0.1\dist\extension.js:188:700
    at Lge (c:\Users\onlyme\.vscode\extensions\rvest.vs-code-prettier-eslint-5.0.1\dist\extension.js:180:1439)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

from prettier-eslint-cli.

barroudjo avatar barroudjo commented on June 10, 2024

Just realized my issue corresponds to the same problem as this one: #434

from prettier-eslint-cli.

JounQin avatar JounQin commented on June 10, 2024

See #434 (comment)

Otherwise, please provide a minimal but runnable reproduction.

https://antfu.me/posts/why-reproductions-are-required

from prettier-eslint-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.