GithubHelp home page GithubHelp logo

Comments (11)

Joezo avatar Joezo commented on July 24, 2024

If i'm honest the implementation for finding the correct config file to use and how it uses it isn't quite right at the moment. Will get around to sorting this out though if nobody puts in a pull request :)

from atom-jshint.

atuttle avatar atuttle commented on July 24, 2024

Is it supposed to be .jshint or .jshintrc?

from atom-jshint.

erikdonohoo avatar erikdonohoo commented on July 24, 2024

It is supposed to be .jshintrc filesβ€”
Sent from Mailbox

On Fri, May 9, 2014 at 7:45 AM, Adam Tuttle [email protected]
wrote:

Is it supposed to be .jshint or .jshintrc?

Reply to this email directly or view it on GitHub:
#30 (comment)

from atom-jshint.

atuttle avatar atuttle commented on July 24, 2024

@Joezo I see how config is searched for and loaded here

I wouldn't mind taking a stab at trying to improve it. Did you have anything specific in mind?

from atom-jshint.

erikdonohoo avatar erikdonohoo commented on July 24, 2024

Ideally when a file is saved (or being edited) a search would start from the directory of the file open and continue up the tree until a .jshintrc file is found. This way if you have a different configuration for jshint in a test directory than you do for your project overall, those rules would be respected instead

from atom-jshint.

erikdonohoo avatar erikdonohoo commented on July 24, 2024

But this loading and searching for configuration would need to occur each time the active file is changed or saved, not just when atom opens.

from atom-jshint.

Joezo avatar Joezo commented on July 24, 2024

I'm not sure the search for config would need to happen each time a file is saved, just when is it opened would suffice? We could keep a hash of what config file is relevant to each open file so that we don't even need to search every time we switch file. Obviously we would need to if a new file was opened. The only concern there is if a file is moved, or a new config file is placed in the folder after the we've already searched. I'm really open to suggestions though and as long as the code works and doesn't slow things down i'd be happy to accept PRs. Please do have a go!

from atom-jshint.

erikdonohoo avatar erikdonohoo commented on July 24, 2024

Keeping the hash is a good call. If the hash has a full file path to a config to use then when a file is moved it would be invalidated and a new config would need to be found for it. And when a new .jshintrc is created somewhere in he project the cache could just be invalidated so that searches could take this into account.

from atom-jshint.

Joezo avatar Joezo commented on July 24, 2024

Sounds like a good plan to me πŸ‘

from atom-jshint.

atuttle avatar atuttle commented on July 24, 2024

Just found this: https://github.com/tkellen/node-liftoff -- maybe it would be useful here?

from atom-jshint.

Joezo avatar Joezo commented on July 24, 2024

This is now resolved and will be usable in the next release

from atom-jshint.

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.