Coder Social home page Coder Social logo

Vim plugin about standard HOT 15 CLOSED

standard avatar standard commented on May 9, 2024
Vim plugin

from standard.

Comments (15)

mikesherov avatar mikesherov commented on May 9, 2024

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.

mightyiam avatar mightyiam commented on May 9, 2024

@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.

mikesherov avatar mikesherov commented on May 9, 2024

You can already run jscs with an file using the config option.

from standard.

nzakas avatar nzakas commented on May 9, 2024

Ditto ESLint using the -c option.

from standard.

mightyiam avatar mightyiam commented on May 9, 2024

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.

nzakas avatar nzakas commented on May 9, 2024

ESLint already allows you to have configuration in package.json: http://eslint.org/docs/configuring/

from standard.

Flet avatar Flet commented on May 9, 2024

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.

feross avatar feross commented on May 9, 2024

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.

mightyiam avatar mightyiam commented on May 9, 2024

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.

mightyiam avatar mightyiam commented on May 9, 2024

If we do this at the lower, ESLint&JSCS level, we don't need any editors to recognize Standard.

from standard.

feross avatar feross commented on May 9, 2024

@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.

lcd047 avatar lcd047 commented on May 9, 2024

@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.

feross avatar feross commented on May 9, 2024

@lcd047 Hey, fixed the issue in 2.6.1. Care to give it a try?

from standard.

lcd047 avatar lcd047 commented on May 9, 2024

@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.

mightyiam avatar mightyiam commented on May 9, 2024

Thank you very much, @feross and @lcd047.

from standard.

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.