question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

prettier-eslint-cli tries to format folder whos name ends with '.js'

See original GitHub issue
  • prettier-eslint-cli version: 5.0.0
  • prettier version: 1.18.2
  • eslint version: 4.19.1

What you did: Executed prettier-eslint --write \"server/**/*.js\" \"client/**/*.js\" \"tests/**/*.js\" \"imports/**/*.js\" from a npm script

What happened: Received the output:

prettier-eslint-cli [ERROR]: There was an error formatting "internal/path/to/folder/FinishSetup.js":
    Error: EISDIR: illegal operation on a directory, read
prettier-eslint-cli [ERROR]: There was an error formatting "internal/path/to/folder/TimeSlot.js":
    Error: EISDIR: illegal operation on a directory, read
success formatting 1 file with prettier-eslint
failure formatting 2 files with prettier-eslint
1520 files were unchanged

Problem description: It seems that prettier-eslint-cli doesn’t check whether it is trying to format a file or a folder and relies just on the name.

Suggested solution: There should be a check in place so that even folders that are named something.js are viewed as folders.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

6reactions
egemoncommented, Nov 29, 2019

any updates?

3reactions
seyarcommented, Feb 25, 2020

I had the same error. But then I pass full path

./node_modules/.bin/prettier-eslint --write /Users/someuser/Projects/someproject/client/**/*.js there are no errors

Read more comments on GitHub >

github_iconTop Results From Across the Web

uglify not able to distinguish between folder and file ending in .js
First of all it's better to avoid .js for folder names. It's not the best practice. Just try adding 'app/**/*.js'. But I'm not...
Read more >
Naming Files, Paths, and Namespaces - Win32 apps
A file name is relative to the current directory if it does not begin with one of the following: A UNC name of...
Read more >
How To Work with Files using the fs Module in Node.js
With Node.js, you can use JavaScript to programmatically manipulate files with the built-in fs module. The name is short for “file system,” ...
Read more >
File Naming Conventions: simple rules save time and effort
Naming folders and files in a consistent, logical and predictable way means that ... The file name describes, at a glance, what the...
Read more >
How to get the exact file names? - Help - UiPath Forum
I am using UI path for my development. Have few clarifications below . I am trying to get the File name exactly from...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found