Code Monkey home page Code Monkey logo

Comments (3)

gepoch avatar gepoch commented on July 19, 2024

Unfortunately no. This linter just wraps the upstream https://github.com/btford/write-good which doesn't handle this, and the Atom linter system has no solution for limiting the scope of where a linter runs.

from linter-write-good.

envygeeks avatar envygeeks commented on July 19, 2024

@gepoch there must be a way to do it, considering that one of the official linters (tidy) has support for scopes: https://github.com/AtomLinter/linter-tidy, wrapping around something else doesn't prevent you from using scopes, and it seems neither does being inside of AtomLinter.

from linter-write-good.

gepoch avatar gepoch commented on July 19, 2024

Are you referring to the "grammarScopes" setting in that package?

grammarScopes just decides what file types the linter applies to. It doesn't control any higher-resolution application of the linter, unfortunately.

From the linter docs:

grammarScopes is an array of scopes your Linter provider should be invoked on. To determine the proper value, put your cursor in an editor in a location where you expect your provider to activate and run Editor: Log Cursor Scope from the Atom Command Palette, you’ll get a list of scopes, one of which should start with “source”. Choose the most specific source.___ entry as what you use in grammarScopes. If your base linter is able to handle multiple types of files, enter each scope individually in the array.

Notice the scope starts with "source._" That's the language level grammar. You can't specify anything narrower. If you try to set grammarScopes to something more specific, it doesn't work.

At any rate, if you look at the tidy linter source, it's working in the same way that linter-write-good works. It just invokes the upstream linter on the entire file and then marshals the output into a data structure so that linter can parse an display it. This package is just a bridge to the write-good library, and that remains the best place to address the issue.

from linter-write-good.

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.