Git Product home page Git Product logo

Comments (7)

Dinnerbone avatar Dinnerbone commented on May 19, 2024 1

For me, on windows, it's a shell script:

#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")

case `uname` in
    *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac

if [ -x "$basedir/node" ]; then
  "$basedir/node"  "$basedir/../eslint/bin/eslint.js" "$@"
  ret=$?
else 
  node  "$basedir/../eslint/bin/eslint.js" "$@"
  ret=$?
fi
exit $ret

from eslint-formatter.

TheSavior avatar TheSavior commented on May 19, 2024

#17 hasn't been released yet.

This is an interesting issue. I wonder why calling node_modules/.bin/eslint would cause errors. It should just be a symlink to the file in node_modules/eslint/bin:

lrwxr-xr-x   1 me  staff    23B Jun 30 01:56 eslint -> ../eslint/bin/eslint.js

from eslint-formatter.

TheSavior avatar TheSavior commented on May 19, 2024

Look at that, I just learned something new about npm on windows.

I'd happily accept a pull request for this case. I unfortunately don't have any easy way to test and validate that functionality.

from eslint-formatter.

Dinnerbone avatar Dinnerbone commented on May 19, 2024

I mean, I'm not sure why on windows it makes a shell file of all things, but hey!

I'll try changing it to search for node_modules/eslint/bin/eslint instead of node_modules/.bin/eslint and see if it works for me.

from eslint-formatter.

TheSavior avatar TheSavior commented on May 19, 2024

I'm thinking we'd likely want to continue running the normal .bin/eslint file on non-windows platforms. I'm kinda leaning towards the "If it aint broke, don't fix it" mentality. Especially since we haven't figured out how to write tests for this repo.

from eslint-formatter.

Dinnerbone avatar Dinnerbone commented on May 19, 2024

The default global path on windows is already eslint/bin/eslint, but the other OSes go to the generic bin folder.

Do you want me to make a pull request that duplicates the eslint_path setting for local search paths? I imagine it'd look like:

  // The location to search for a locally installed eslint package
  // If this is not found, it will try to use the global package (see 'eslint_path')
  "local_eslint_path": {
    "windows": "./node_modules/eslint/bin/eslint",
    "linux": "./node_modules/.bin/eslint",
    "osx": "./node_modules/.bin/eslint"
  },

from eslint-formatter.

TheSavior avatar TheSavior commented on May 19, 2024

Yeah, that seems like a reasonable approach, thanks.

from eslint-formatter.

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.