Comments (15)
JSCS will not be patching itself to recognize standard. The correct way to do this would be to make standard a jscs plugin and an eslint plugin, rather than something that uses both of those tools.
from standard.
@mikesherov and @nzakas,
Thank you for commenting.
Perhaps JSCS and ESLint can be patched to recognize to look for something other than an rcfile in the current directory? Are you open for that?
I'm thinking perhaps a property in package.json
, which provides paths to rcfiles:
{
"name": "my-package",
"rcfiles": ["node_modules/standard/rc"]
}
In Standard, I'm looking for the least amount of actions for setting it up.
Editing package.json
(to prefix the test script with standard &&
) is probably already part of the workflow of setting Standard up, so adding the rcfiles
property/value is just another step in the same file.
Perhaps addition of rcfiles
can be made automagical, using standard
's npm postinstall
script?
from standard.
You can already run jscs with an file using the config
option.
from standard.
Ditto ESLint using the -c
option.
from standard.
I'm looking for a way that will not require anyway to alter the way that ESLint & JSCS are called.
For example, ESLint is called automatically from my VIM plugin.
The current existing way of providing rules is the presence of rcfiles.
But that is not flexible enough for my purpose because that requires Standard to put such files in place in the repo where it is used and that is not such a great possibility, as you can imagine.
The little addition of a property to package.json
is an acceptable, pleasant, non–destructive alteration.
If only ESLint and JSCS will follow such a property, it will be one possible solution. Are you open to anything like this?
from standard.
ESLint already allows you to have configuration in package.json: http://eslint.org/docs/configuring/
from standard.
A better approach might be to create a vim plugin specifically for standard
. It may be worth getting this added to syntastic.
It looks like someone opened an issue for it already: vim-syntastic/syntastic/issues/1314
from standard.
The correct approach is to create a vim plugin for standard
.
@Flet already wrote a Sublime Text plugin. It's quite easy to do, since the output is easily parseable. You can see the regex to use here.
Ideally, a dedicated vim user would step up and write this plugin! I use vim as my secondary editor (only when I'm ssh'd into a server, and usually without syntax highlighting).
from standard.
I'll use VIM so I'll benefit. But what about all the other editors?
@nzakas it allows configuration in package.json but it doesn't allow a directive/rule that allows us to provide a path to an rcfile, right? An include rule would be perfect. Would you be open to an include rule?
from standard.
If we do this at the lower, ESLint&JSCS level, we don't need any editors to recognize Standard.
from standard.
@mightyiam Please take your feature request directly to the jscs or eslint issue trackers.
Let's use this issue to track progress on a vim plugin. If someone writes this, let me know and we can link it from the README.
from standard.
@feross Syntastic maintainer here. Writing a syntastic checker for standard would be mostly trivial, provided that you fix this. :) As it is now, running
:echo system('standard file.js')
from Vim yields nothing, since stdin
as seen by standard is not a TTY.
from standard.
@lcd047 Hey, fixed the issue in 2.6.1. Care to give it a try?
from standard.
@feross Excellent! It works now, and I added a syntastic checker for it in c1a2098.
Unrelated however, error highlighting in syntastic seem to imply column numbers for eslint
, except the ones referring to semicolons, are off by one.
from standard.
Thank you very much, @feross and @lcd047.
from standard.
Related Issues (20)
- Formatting code will make it unreadable
- Expanding Rostislav and I's contribution, into core
- TS-Standart Changed My Code and Throwing Error
- Create a tutorial to use Standard together with Husky
- Eslint v9 support HOT 2
- Add a lock file HOT 3
- Could you please paste the result of the `npm ls eslint` command? HOT 1
- Remove the lock-threads workflow
- Comments bring issues/PRs onto the project board HOT 1
- tittle
- space-unary-ops errors on `new Class()` syntax HOT 4
- Maintenance & Governance of standard HOT 47
- Format using a formatter instead of ESLint formatting rules HOT 15
- inline link with @ in Super to have link inline or below not above HOT 1
- Tags isn't exported with Export .md or HTML HOT 1
- Ctrl+Shift+E to open/close tag page isn't working HOT 2
- `standard.lintFiles()` doesn't use `process.cwd()` HOT 5
- RFC: eslint-config-standard-with-typescript to depart from standard HOT 19
- Rule suggestion: no-constant-binary-expression
- Linting in precommit hooks says File not found
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 standard.