In Node, JavaScript case problem, windows vs mac Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Create GUID / UUID in JavaScript?How do JavaScript closures work?What is the most efficient way to deep clone an object in JavaScript?How do I remove a property from a JavaScript object?Which equals operator (== vs ===) should be used in JavaScript comparisons?How do I include a JavaScript file in another JavaScript file?What does “use strict” do in JavaScript, and what is the reasoning behind it?How to check whether a string contains a substring in JavaScript?How do I remove a particular element from an array in JavaScript?For-each over an array in JavaScript?

Did any compiler fully use 80-bit floating point?

Google .dev domain strangely redirects to https

A term for a woman complaining about things/begging in a cute/childish way

Tannaka duality for semisimple groups

Test print coming out spongy

Are the endpoints of the domain of a function counted as critical points?

Flight departed from the gate 5 min before scheduled departure time. Refund options

Putting class ranking in CV, but against dept guidelines

Printing attributes of selection in ArcPy?

Found this skink in my tomato plant bucket. Is he trapped? Or could he leave if he wanted?

What are the main differences between Stargate SG-1 cuts?

How can I save and copy a screenhot at the same time?

How to change the tick of the color bar legend to black

As a dual citizen, my US passport will expire one day after traveling to the US. Will this work?

Can you force honesty by using the Speak with Dead and Zone of Truth spells together?

Is there hard evidence that the grant peer review system performs significantly better than random?

License to disallow distribution in closed source software, but allow exceptions made by owner?

Resize vertical bars (absolute-value symbols)

What is the origin of 落第?

How to ask rejected full-time candidates to apply to teach individual courses?

Simple Http Server

Is multiple magic items in one inherently imbalanced?

In musical terms, what properties are varied by the human voice to produce different words / syllables?

What would you call this weird metallic apparatus that allows you to lift people?



In Node, JavaScript case problem, windows vs mac



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
Data science time! April 2019 and salary with experience
The Ask Question Wizard is Live!Create GUID / UUID in JavaScript?How do JavaScript closures work?What is the most efficient way to deep clone an object in JavaScript?How do I remove a property from a JavaScript object?Which equals operator (== vs ===) should be used in JavaScript comparisons?How do I include a JavaScript file in another JavaScript file?What does “use strict” do in JavaScript, and what is the reasoning behind it?How to check whether a string contains a substring in JavaScript?How do I remove a particular element from an array in JavaScript?For-each over an array in JavaScript?



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








4















I'm finding that we have dev's on windows that are checking in code that works even though it has file name casing errors like:



import speakers.js


instead of



import Speakers.js


Which is correct. On windows, it works, Mac it does not. What's the best way to insure that windows devs don't check in problem code like this?










share|improve this question






















  • That probably depends on your version control system and not on nodejs or javascript

    – UnholySheep
    Mar 8 at 23:20











  • It's not just Mac vs. Windows, it's all UNIX-like OS's vs. Windows. Windows (NT) systems might be the only OS's that do this.

    – David Kamer
    Mar 8 at 23:40

















4















I'm finding that we have dev's on windows that are checking in code that works even though it has file name casing errors like:



import speakers.js


instead of



import Speakers.js


Which is correct. On windows, it works, Mac it does not. What's the best way to insure that windows devs don't check in problem code like this?










share|improve this question






















  • That probably depends on your version control system and not on nodejs or javascript

    – UnholySheep
    Mar 8 at 23:20











  • It's not just Mac vs. Windows, it's all UNIX-like OS's vs. Windows. Windows (NT) systems might be the only OS's that do this.

    – David Kamer
    Mar 8 at 23:40













4












4








4


1






I'm finding that we have dev's on windows that are checking in code that works even though it has file name casing errors like:



import speakers.js


instead of



import Speakers.js


Which is correct. On windows, it works, Mac it does not. What's the best way to insure that windows devs don't check in problem code like this?










share|improve this question














I'm finding that we have dev's on windows that are checking in code that works even though it has file name casing errors like:



import speakers.js


instead of



import Speakers.js


Which is correct. On windows, it works, Mac it does not. What's the best way to insure that windows devs don't check in problem code like this?







javascript node.js






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 8 at 23:17









PetePete

420311




420311












  • That probably depends on your version control system and not on nodejs or javascript

    – UnholySheep
    Mar 8 at 23:20











  • It's not just Mac vs. Windows, it's all UNIX-like OS's vs. Windows. Windows (NT) systems might be the only OS's that do this.

    – David Kamer
    Mar 8 at 23:40

















  • That probably depends on your version control system and not on nodejs or javascript

    – UnholySheep
    Mar 8 at 23:20











  • It's not just Mac vs. Windows, it's all UNIX-like OS's vs. Windows. Windows (NT) systems might be the only OS's that do this.

    – David Kamer
    Mar 8 at 23:40
















That probably depends on your version control system and not on nodejs or javascript

– UnholySheep
Mar 8 at 23:20





That probably depends on your version control system and not on nodejs or javascript

– UnholySheep
Mar 8 at 23:20













It's not just Mac vs. Windows, it's all UNIX-like OS's vs. Windows. Windows (NT) systems might be the only OS's that do this.

– David Kamer
Mar 8 at 23:40





It's not just Mac vs. Windows, it's all UNIX-like OS's vs. Windows. Windows (NT) systems might be the only OS's that do this.

– David Kamer
Mar 8 at 23:40












2 Answers
2






active

oldest

votes


















2














Use a linter



Linters are programs that validates that your source code complies with some rules. A linter may forbid the use of the var keyword, or may enforce that a semicolon is present at the end of a line.



In javascript, the most common linter is eslint. It is reasonable easy to setup and most code editors play well with it.



There is a specific eslint plugin that checks that some rules are enforced in require and import calls: eslint plugin dependencies. It enforce that files exist or that file names are/are not case sensitive, so this plugin should do the trick for you. (However, I never configured it by myself. I believe most cli apps from javascript frameworks include it in their default configuration).



If you setup this properly, developers will see warnings in their editors when they try to use mayus within import or require sentences, and the command eslint will fail if run.



 Use javascript hooks to ensure no invalid commit is pushed to the repository



Using git hooks, you can enforce that eslint (or any other linter or command) must pass in order for a commit to be added to a repository.



This article explain how to do this with javascript (disclaimer, I'm the author), and provides some context on the matter.



Also there is the husky package that easily allows you to setup git hooks to prevent bad commits. The good thing about using husky is that the hooks can get pushed to the repository, so new developers on the project don't need to manually setup their .git/hooks/ files.






share|improve this answer
































    1














    This is definitely an OS problem. Didnt try yet but you can activate the windows case sensitive option to avoid import errors. You have to execute the following command:



    fsutil.exe file SetCaseSensitiveInfo C:folderpath enable


    Be advice:



    • Linux Subsystem should be enabled:
      Run the following command as Administrator in PowerShell to enable this optional feature:

    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux



    • It doesnt affect subfolders so a recursive script would be needed





    share|improve this answer

























    • this is why I have a rule for my teams that all files are to be lowercase only

      – Steven Stark
      Mar 9 at 0:16











    • Thats the fastest option, but I like classes in UpperCamelCase :(

      – Rashomon
      Mar 9 at 0:40











    • windows does not know what upper case files even are. On windows This.txt and this.txt are the same, but on *nix and OSX they are completely different files.

      – Steven Stark
      Mar 9 at 1:49












    • I know, thats the problem. If I use import Speakers.js for speakers.js I wont notice any error in my enviroment, but my import wont work for my coworkers using different OS

      – Rashomon
      Mar 9 at 8:06











    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55072316%2fin-node-javascript-case-problem-windows-vs-mac%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    Use a linter



    Linters are programs that validates that your source code complies with some rules. A linter may forbid the use of the var keyword, or may enforce that a semicolon is present at the end of a line.



    In javascript, the most common linter is eslint. It is reasonable easy to setup and most code editors play well with it.



    There is a specific eslint plugin that checks that some rules are enforced in require and import calls: eslint plugin dependencies. It enforce that files exist or that file names are/are not case sensitive, so this plugin should do the trick for you. (However, I never configured it by myself. I believe most cli apps from javascript frameworks include it in their default configuration).



    If you setup this properly, developers will see warnings in their editors when they try to use mayus within import or require sentences, and the command eslint will fail if run.



     Use javascript hooks to ensure no invalid commit is pushed to the repository



    Using git hooks, you can enforce that eslint (or any other linter or command) must pass in order for a commit to be added to a repository.



    This article explain how to do this with javascript (disclaimer, I'm the author), and provides some context on the matter.



    Also there is the husky package that easily allows you to setup git hooks to prevent bad commits. The good thing about using husky is that the hooks can get pushed to the repository, so new developers on the project don't need to manually setup their .git/hooks/ files.






    share|improve this answer





























      2














      Use a linter



      Linters are programs that validates that your source code complies with some rules. A linter may forbid the use of the var keyword, or may enforce that a semicolon is present at the end of a line.



      In javascript, the most common linter is eslint. It is reasonable easy to setup and most code editors play well with it.



      There is a specific eslint plugin that checks that some rules are enforced in require and import calls: eslint plugin dependencies. It enforce that files exist or that file names are/are not case sensitive, so this plugin should do the trick for you. (However, I never configured it by myself. I believe most cli apps from javascript frameworks include it in their default configuration).



      If you setup this properly, developers will see warnings in their editors when they try to use mayus within import or require sentences, and the command eslint will fail if run.



       Use javascript hooks to ensure no invalid commit is pushed to the repository



      Using git hooks, you can enforce that eslint (or any other linter or command) must pass in order for a commit to be added to a repository.



      This article explain how to do this with javascript (disclaimer, I'm the author), and provides some context on the matter.



      Also there is the husky package that easily allows you to setup git hooks to prevent bad commits. The good thing about using husky is that the hooks can get pushed to the repository, so new developers on the project don't need to manually setup their .git/hooks/ files.






      share|improve this answer



























        2












        2








        2







        Use a linter



        Linters are programs that validates that your source code complies with some rules. A linter may forbid the use of the var keyword, or may enforce that a semicolon is present at the end of a line.



        In javascript, the most common linter is eslint. It is reasonable easy to setup and most code editors play well with it.



        There is a specific eslint plugin that checks that some rules are enforced in require and import calls: eslint plugin dependencies. It enforce that files exist or that file names are/are not case sensitive, so this plugin should do the trick for you. (However, I never configured it by myself. I believe most cli apps from javascript frameworks include it in their default configuration).



        If you setup this properly, developers will see warnings in their editors when they try to use mayus within import or require sentences, and the command eslint will fail if run.



         Use javascript hooks to ensure no invalid commit is pushed to the repository



        Using git hooks, you can enforce that eslint (or any other linter or command) must pass in order for a commit to be added to a repository.



        This article explain how to do this with javascript (disclaimer, I'm the author), and provides some context on the matter.



        Also there is the husky package that easily allows you to setup git hooks to prevent bad commits. The good thing about using husky is that the hooks can get pushed to the repository, so new developers on the project don't need to manually setup their .git/hooks/ files.






        share|improve this answer















        Use a linter



        Linters are programs that validates that your source code complies with some rules. A linter may forbid the use of the var keyword, or may enforce that a semicolon is present at the end of a line.



        In javascript, the most common linter is eslint. It is reasonable easy to setup and most code editors play well with it.



        There is a specific eslint plugin that checks that some rules are enforced in require and import calls: eslint plugin dependencies. It enforce that files exist or that file names are/are not case sensitive, so this plugin should do the trick for you. (However, I never configured it by myself. I believe most cli apps from javascript frameworks include it in their default configuration).



        If you setup this properly, developers will see warnings in their editors when they try to use mayus within import or require sentences, and the command eslint will fail if run.



         Use javascript hooks to ensure no invalid commit is pushed to the repository



        Using git hooks, you can enforce that eslint (or any other linter or command) must pass in order for a commit to be added to a repository.



        This article explain how to do this with javascript (disclaimer, I'm the author), and provides some context on the matter.



        Also there is the husky package that easily allows you to setup git hooks to prevent bad commits. The good thing about using husky is that the hooks can get pushed to the repository, so new developers on the project don't need to manually setup their .git/hooks/ files.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Mar 9 at 9:13

























        answered Mar 8 at 23:33









        SergeonSergeon

        3,159919




        3,159919























            1














            This is definitely an OS problem. Didnt try yet but you can activate the windows case sensitive option to avoid import errors. You have to execute the following command:



            fsutil.exe file SetCaseSensitiveInfo C:folderpath enable


            Be advice:



            • Linux Subsystem should be enabled:
              Run the following command as Administrator in PowerShell to enable this optional feature:

            Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux



            • It doesnt affect subfolders so a recursive script would be needed





            share|improve this answer

























            • this is why I have a rule for my teams that all files are to be lowercase only

              – Steven Stark
              Mar 9 at 0:16











            • Thats the fastest option, but I like classes in UpperCamelCase :(

              – Rashomon
              Mar 9 at 0:40











            • windows does not know what upper case files even are. On windows This.txt and this.txt are the same, but on *nix and OSX they are completely different files.

              – Steven Stark
              Mar 9 at 1:49












            • I know, thats the problem. If I use import Speakers.js for speakers.js I wont notice any error in my enviroment, but my import wont work for my coworkers using different OS

              – Rashomon
              Mar 9 at 8:06















            1














            This is definitely an OS problem. Didnt try yet but you can activate the windows case sensitive option to avoid import errors. You have to execute the following command:



            fsutil.exe file SetCaseSensitiveInfo C:folderpath enable


            Be advice:



            • Linux Subsystem should be enabled:
              Run the following command as Administrator in PowerShell to enable this optional feature:

            Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux



            • It doesnt affect subfolders so a recursive script would be needed





            share|improve this answer

























            • this is why I have a rule for my teams that all files are to be lowercase only

              – Steven Stark
              Mar 9 at 0:16











            • Thats the fastest option, but I like classes in UpperCamelCase :(

              – Rashomon
              Mar 9 at 0:40











            • windows does not know what upper case files even are. On windows This.txt and this.txt are the same, but on *nix and OSX they are completely different files.

              – Steven Stark
              Mar 9 at 1:49












            • I know, thats the problem. If I use import Speakers.js for speakers.js I wont notice any error in my enviroment, but my import wont work for my coworkers using different OS

              – Rashomon
              Mar 9 at 8:06













            1












            1








            1







            This is definitely an OS problem. Didnt try yet but you can activate the windows case sensitive option to avoid import errors. You have to execute the following command:



            fsutil.exe file SetCaseSensitiveInfo C:folderpath enable


            Be advice:



            • Linux Subsystem should be enabled:
              Run the following command as Administrator in PowerShell to enable this optional feature:

            Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux



            • It doesnt affect subfolders so a recursive script would be needed





            share|improve this answer















            This is definitely an OS problem. Didnt try yet but you can activate the windows case sensitive option to avoid import errors. You have to execute the following command:



            fsutil.exe file SetCaseSensitiveInfo C:folderpath enable


            Be advice:



            • Linux Subsystem should be enabled:
              Run the following command as Administrator in PowerShell to enable this optional feature:

            Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux



            • It doesnt affect subfolders so a recursive script would be needed






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Mar 9 at 0:08

























            answered Mar 8 at 23:34









            RashomonRashomon

            600418




            600418












            • this is why I have a rule for my teams that all files are to be lowercase only

              – Steven Stark
              Mar 9 at 0:16











            • Thats the fastest option, but I like classes in UpperCamelCase :(

              – Rashomon
              Mar 9 at 0:40











            • windows does not know what upper case files even are. On windows This.txt and this.txt are the same, but on *nix and OSX they are completely different files.

              – Steven Stark
              Mar 9 at 1:49












            • I know, thats the problem. If I use import Speakers.js for speakers.js I wont notice any error in my enviroment, but my import wont work for my coworkers using different OS

              – Rashomon
              Mar 9 at 8:06

















            • this is why I have a rule for my teams that all files are to be lowercase only

              – Steven Stark
              Mar 9 at 0:16











            • Thats the fastest option, but I like classes in UpperCamelCase :(

              – Rashomon
              Mar 9 at 0:40











            • windows does not know what upper case files even are. On windows This.txt and this.txt are the same, but on *nix and OSX they are completely different files.

              – Steven Stark
              Mar 9 at 1:49












            • I know, thats the problem. If I use import Speakers.js for speakers.js I wont notice any error in my enviroment, but my import wont work for my coworkers using different OS

              – Rashomon
              Mar 9 at 8:06
















            this is why I have a rule for my teams that all files are to be lowercase only

            – Steven Stark
            Mar 9 at 0:16





            this is why I have a rule for my teams that all files are to be lowercase only

            – Steven Stark
            Mar 9 at 0:16













            Thats the fastest option, but I like classes in UpperCamelCase :(

            – Rashomon
            Mar 9 at 0:40





            Thats the fastest option, but I like classes in UpperCamelCase :(

            – Rashomon
            Mar 9 at 0:40













            windows does not know what upper case files even are. On windows This.txt and this.txt are the same, but on *nix and OSX they are completely different files.

            – Steven Stark
            Mar 9 at 1:49






            windows does not know what upper case files even are. On windows This.txt and this.txt are the same, but on *nix and OSX they are completely different files.

            – Steven Stark
            Mar 9 at 1:49














            I know, thats the problem. If I use import Speakers.js for speakers.js I wont notice any error in my enviroment, but my import wont work for my coworkers using different OS

            – Rashomon
            Mar 9 at 8:06





            I know, thats the problem. If I use import Speakers.js for speakers.js I wont notice any error in my enviroment, but my import wont work for my coworkers using different OS

            – Rashomon
            Mar 9 at 8:06

















            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55072316%2fin-node-javascript-case-problem-windows-vs-mac%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

            Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

            Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved