Comments (7)
Hi Arne,
Definitely. The setup steps are documented in the readme:
- Set up
.tm_properties
: https://github.com/rondevera/jslintmate/#textmate-2 (just the "Project setup" part) - Set up an options file (separate from
.tm_properties
): https://github.com/rondevera/jslintmate/#keep-an-options-file-in-your-project
Here are some example options files to get you started: https://github.com/rondevera/jslintmate/tree/master/Support/config/
This lets you have separate JSLint/JSHint options per project, and you can run JSLintMate with either JSLint or JSHint for each project as needed. However, the TM_JSLINTMATE_DEFAULT_LINTER
setting is the same across all projects.
Cheers,
Ron
from jslintmate.
Yes, I am aware of this, but I am talking about overriding TM_JSLINTMATE_DEFAULT_LINTER, TM_JSLINTMATE_JSHINT_OPTIONS_FILE, TM_JSLINTMATE_JSHINT_FILE and the like in .tm_properties, on a per-project basis. Is this possible?
from jslintmate.
Aha, thanks for clarifying; I like your idea. It looks like environment variables stored in .tm_properties
are overridden by those in the "Linters" and "Options Files" settings. However, try this:
-
In
.tm_properties
, set something like:TM_JSLINTMATE_JSHINT_OPTIONS_FILE = "$projectDirectory/project/specific/path/to/jshint.json"
-
In the "Options Files" setting:
{ name = 'TM_JSLINTMATE_JSHINT_OPTIONS_FILE'; value = '$TM_JSLINTMATE_JSHINT_OPTIONS_FILE:~/.jshintrc'; },
The latest version of JSLintMate supports fallback options files, so this should set it up to first check existing environment variables (as set in .tm_properties
), then fall back to your personal .jshintrc
. (Tested this just now.)
This is just for options files, though. TM_JSLINTMATE_DEFAULT_LINTER
doesn't support the same colon syntax for fallbacks, so the same trick wouldn't apply.
I can picture two solutions:
- Add support for colons inside
TM_JSLINTMATE_DEFAULT_LINTER
, allowing it to check for an existing environment variable before using its own, user-chosen default. The commands that ship with JSLintMate could even change to respect.tm_properties
by default with the technique above. - Add support for new
TM_JSLINTMATE_PROJECT_DEFAULT_LINTER
,TM_JSLINTMATE_PROJECT_JSHINT_OPTIONS_FILE
, and other settings. These would be used only in.tm_properties
, so that it's very clear how they differ from the existing regular options. Downside is that they don't apply to TextMate 1.
What do you think?
from jslintmate.
Thank you for a very detailed reply :-) I am already using the colons option for setting a custom .jshintrc per project, and that works great. Having a similar option for selecting which linter to use would solve my woes (such as they are), and for me either of the solutions you outline would work. Feel free to select the option that suits you best. If you are busy, I could look into fixing it myself, and submitting a pull request.
from jslintmate.
Additionally, I would love to be able to disable JSLintMate entirely on a given project. Some times I have to contribute to projects that really don't follow any manner of style that's enforced through JSHint, and I'm not in a position to change that (either because it's not my project, or because I don't have time immediately to bring it up to par).
In such cases the tooltip on save gets really annoying. I have to resort to disabling JSLintMate globally, which I then have to re-enable for my other projects (or, more generally, which I then forget to re-enable until I shoot myself in the foot).
from jslintmate.
The JSHint docs state:
JSHint will look for this file in the current working directory and, if not found,
will move one level up the directory tree all the way up to the filesystem root.
Why doesn't JSLintMate follow that convention? It's so straightforward and is most likely the convention that your collaborators will be using.
from jslintmate.
@MokoJumbie It's definitely a nice convention from node-jshint, and it's been on my todo list to support it. The catch is that it would cause a lot of confusion/complications with the existing TM_JSLINTMATE_{JSLINT,JSHINT}_OPTIONS_FILE
settings. I'd like to support both systems in a future 1.x release, then remove TM_JSLINTMATE_{JSLINT,JSHINT}_OPTIONS_FILE
in 2.0.
from jslintmate.
Related Issues (20)
- Failure - env: bash: No such file or directory HOT 2
- predef ignored when has $ prefix HOT 1
- JSHint doesn't seem to recognize the smarttabs flag HOT 4
- Broken on OSX 10.8 HOT 7
- Config option todo does not work together with browser option HOT 2
- Embedded javascript HOT 2
- Unused variables in callbacks HOT 4
- Unable to install on sublimeText HOT 2
- Save & Run JSLintMate error in Mavericks DP3
- Add Node support
- move to sublime text
- Two issues straight after installation, OSX 10.8.5, TM 1.5.11 (1635)
- undefined method `find' error HOT 10
- support inline jslint config?
- Error in Installing JSLintMate for TextMate in Mavericks HOT 2
- JSLint config unparam not woking
- jshint options -> broken link
- run on unsaved code? HOT 1
- Dosn't work
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jslintmate.