├── .gitignore ├── messages ├── 3.0.1.txt ├── 3.1.0.txt ├── 3.1.4.txt ├── 3.1.1.txt ├── 3.1.2.txt ├── 2.1.0.txt ├── 3.0.0.txt ├── install.txt ├── 3.1.3.txt ├── 1.1.0.txt └── 2.0.0.txt ├── .travis.yml ├── .sublimelinterrc ├── messages.json ├── linter.py ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | -------------------------------------------------------------------------------- /messages/3.0.1.txt: -------------------------------------------------------------------------------- 1 | SublimeLinter-contrib-standard 2 | ------------------------------- 3 | - Removed missing format command from command menu 4 | -------------------------------------------------------------------------------- /messages/3.1.0.txt: -------------------------------------------------------------------------------- 1 | SublimeLinter-contrib-standard 2 | ------------------------------- 3 | 4 | 3.1.0 5 | 6 | Added sublime-babel syntax! Thanks @davidpfahler! -------------------------------------------------------------------------------- /messages/3.1.4.txt: -------------------------------------------------------------------------------- 1 | SublimeLinter-contrib-standard 2 | ------------------------------- 3 | 4 | 3.1.4 5 | 6 | - Fix SublimeLinter-conrib-standard to work with SublimeLinter 4. 7 | -------------------------------------------------------------------------------- /messages/3.1.1.txt: -------------------------------------------------------------------------------- 1 | SublimeLinter-contrib-standard 2 | ------------------------------- 3 | 4 | 3.1.1 5 | 6 | - Will not show an error for space before a closing script tag. 7 | - Thanks @ncrawlins! -------------------------------------------------------------------------------- /messages/3.1.2.txt: -------------------------------------------------------------------------------- 1 | SublimeLinter-contrib-standard 2 | ------------------------------- 3 | 4 | 3.1.2 5 | 6 | - add settings to detect if standard is a project dependency 7 | - Thanks @danreeves! 8 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | dist: xenial 2 | language: python 3 | python: 4 | - "3.7" 5 | # command to install dependencies 6 | install: 7 | - pip install flake8 8 | - pip install pep257 9 | # command to run tests 10 | script: 11 | - flake8 . --max-line-length=120 12 | - pep257 . --ignore=D202,D203 13 | -------------------------------------------------------------------------------- /.sublimelinterrc: -------------------------------------------------------------------------------- 1 | { 2 | "@python": 3, 3 | "linters": { 4 | "flake8": { 5 | "max-line-length": 120 6 | }, 7 | "pep257": { 8 | "ignore": ["D202","D203"] 9 | }, 10 | "pep8": { 11 | "max-line-length": 120 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /messages/2.1.0.txt: -------------------------------------------------------------------------------- 1 | SublimeLinter-contrib-standard 2 | ------------------------------- 3 | 4 | - Minimum required version of standard is now 2.11.0. 5 | - standard-format is no longer required. 6 | 7 | NEW FEATURE 8 | - Its now possible to format only the text thats selected. 9 | - If no text is selected, the entire file will be formatted. -------------------------------------------------------------------------------- /messages/3.0.0.txt: -------------------------------------------------------------------------------- 1 | SublimeLinter-contrib-standard 2 | ------------------------------- 3 | - updated minimum standard version to 3.7.2 4 | - get the latest now: npm install -g standard 5 | - Formatting has been removed from this plugin. 6 | - Install StandardFormat from package control instead! 7 | - (https://github.com/bcomnes/sublime-standard-format) -------------------------------------------------------------------------------- /messages.json: -------------------------------------------------------------------------------- 1 | { 2 | "install": "messages/install.txt", 3 | "1.1.0": "messages/1.1.0.txt", 4 | "2.0.0": "messages/2.0.0.txt", 5 | "2.1.0": "messages/2.1.0.txt", 6 | "3.0.0": "messages/3.0.0.txt", 7 | "3.0.1": "messages/3.0.1.txt", 8 | "3.1.0": "messages/3.1.0.txt", 9 | "3.1.1": "messages/3.1.1.txt", 10 | "3.1.2": "messages/3.1.2.txt", 11 | "3.1.3": "messages/3.1.3.txt", 12 | "3.1.4": "messages/3.1.4.txt" 13 | } 14 | -------------------------------------------------------------------------------- /messages/install.txt: -------------------------------------------------------------------------------- 1 | SublimeLinter-contrib-standard 2 | ------------------------------- 3 | This linter plugin for SublimeLinter provides an interface to standard. 4 | 5 | ** IMPORTANT! ** 6 | 7 | Before this plugin will activate, you *must* 8 | follow the installation instructions here: 9 | 10 | https://github.com/Flet/SublimeLinter-contrib-standard 11 | 12 | Want to automatically format your text? 13 | Install StandardFormat from package control! 14 | (https://github.com/bcomnes/sublime-standard-format) -------------------------------------------------------------------------------- /messages/3.1.3.txt: -------------------------------------------------------------------------------- 1 | SublimeLinter-contrib-standard 2 | ------------------------------- 3 | 4 | 3.1.3 5 | 6 | - Remove the default setting to disable the linter if standard is not a project 7 | dependency. 8 | 9 | If you would like to only lint projects where standard is a dependency there 10 | is a new setting "disable_if_not_dependency" which you can set to true. 11 | 12 | For more information about SublimeLinter settings see the docs: 13 | http://www.sublimelinter.com/en/latest/settings.html 14 | -------------------------------------------------------------------------------- /messages/1.1.0.txt: -------------------------------------------------------------------------------- 1 | SublimeLinter-contrib-standard 2 | 3 | Minimum required version of standard is now 2.10.0. 4 | 5 | Install the latest version of standard: 6 | npm install -g standard 7 | 8 | 9 | NEW FEATURE 10 | ------------ 11 | 12 | A new "Build System" has been added: "JavaScript Standard Style Formatter" 13 | 14 | Press Ctrl+B to reformat your JavaScript to Standard Style! 15 | 16 | This uses `maxogden/standard-format` to do the formatting, which is still 17 | a bit experimental. File formatting bugs here: 18 | https://github.com/maxogden/standard-format/issues 19 | 20 | -------------------------------------------------------------------------------- /linter.py: -------------------------------------------------------------------------------- 1 | # 2 | # linter.py 3 | # Linter for SublimeLinter3, a code checking framework for Sublime Text 3 4 | # 5 | # Written by Dan Flettre 6 | # Copyright (c) 2015 Dan Flettre 7 | # 8 | # License: MIT 9 | # 10 | 11 | """This module exports the Standard plugin class.""" 12 | 13 | from SublimeLinter.lint import NodeLinter 14 | 15 | 16 | class Standard(NodeLinter): 17 | """Provides an interface to standard.""" 18 | 19 | cmd = 'standard --stdin --verbose' 20 | name = 'Standard' 21 | regex = r'^\s.+:(?P\d+):(?P\d+):(?P.+)' 22 | 23 | defaults = { 24 | 'enable_if_dependency': True, 25 | 'disable_if_not_dependency': False, 26 | 'selector': 'source.js, source.jsx' 27 | } 28 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Permission is hereby granted, free of charge, to any person obtaining a copy 2 | of this software and associated documentation files (the "Software"), to deal 3 | in the Software without restriction, including without limitation the rights 4 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 5 | copies of the Software, and to permit persons to whom the Software is 6 | furnished to do so, subject to the following conditions: 7 | 8 | The above copyright notice and this permission notice shall be included in 9 | all copies or substantial portions of the Software. 10 | 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | -------------------------------------------------------------------------------- /messages/2.0.0.txt: -------------------------------------------------------------------------------- 1 | SublimeLinter-contrib-standard 2 | 3 | Minimum required version of standard is now 2.10.0. 4 | 5 | Install the latest version of standard and standard-format 6 | npm install -g standard standard-format 7 | 8 | 9 | New Technique for Formatting Text 10 | ---------------------------------- 11 | 12 | The "Build System" has been removed as it was a bit buggy and strange. 13 | 14 | Instead, format a file to JavaScript Standard Style by doing one of the following: 15 | 16 | - open the [Command Palette][cmd] and type: 17 | Format: JavaScript Standard Style 18 | 19 | - Use the default shortcut: `ctrl+alt+f` 20 | 21 | If the shortcut is already mapped or you wish to have a different key mapped: 22 | - open Preferences > Key Bindings (User) and map a key to the `standard_format` command: 23 | 24 | { "keys": ["ctrl+alt+f"], "command": "standard_format", "context": [{"key": "selector", "operator": "equal", "operand": "source.js,source.json"}] }, 25 | 26 | NOTE: be sure to install standard and standard-format: 27 | 28 | npm install -g standard standard-format 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | SublimeLinter-contrib-standard 2 | ================================ 3 | 4 | [![Build Status](https://travis-ci.org/Flet/SublimeLinter-contrib-standard.svg?branch=master)](https://travis-ci.org/Flet/SublimeLinter-contrib-standard) 5 | 6 | This linter plugin for [SublimeLinter][docs] provides an interface to [standard](https://www.npmjs.com/package/standard). It will be used with files that have the “javascript” syntax. 7 | 8 | ## Installation 9 | SublimeLinter 3 must be installed in order to use this plugin. If SublimeLinter 3 is not installed, please follow the instructions [here][installation]. 10 | 11 | ### Linter installation 12 | Before using this plugin, you must ensure that `standard` is installed on your system. To install `standard`, do the following: 13 | 14 | 1. Install [Node.js](http://nodejs.org) (and [npm](https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager) on Linux). 15 | 16 | 1. Install `standard` by typing the following command in a terminal: 17 | ``` 18 | npm install -g standard 19 | ``` 20 | 21 | 1. If you are using `nvm` and `zsh`, ensure that the line to load `nvm` is in `.zshenv` and not `.zshrc`. 22 | 23 | 1. If you are using `zsh` and `oh-my-zsh`, do not load the `nvm` plugin for `oh-my-zsh`. 24 | 25 | ### Linter configuration 26 | In order for `standard` to be executed by SublimeLinter, you must ensure that its path is available to SublimeLinter. Before going any further, please read and follow the steps in [“Finding a linter executable”](http://sublimelinter.readthedocs.org/en/latest/troubleshooting.html#finding-a-linter-executable) through “Validating your PATH” in the documentation. 27 | 28 | Once you have installed and configured `standard`, you can proceed to install the SublimeLinter-contrib-standard plugin if it is not yet installed. 29 | 30 | ### Plugin installation 31 | Please use [Package Control][pc] to install the linter plugin. This will ensure that the plugin will be updated when new versions are available. If you want to install from source so you can modify the source code, you probably know what you are doing so we won’t cover that here. 32 | 33 | To install via Package Control, do the following: 34 | 35 | 1. Within Sublime Text, bring up the [Command Palette][cmd] and type `install`. Among the commands you should see `Package Control: Install Package`. If that command is not highlighted, use the keyboard or mouse to select it. There will be a pause of a few seconds while Package Control fetches the list of available plugins. 36 | 37 | 1. When the plugin list appears, type `standard`. Among the entries you should see `SublimeLinter-contrib-standard`. If that entry is not highlighted, use the keyboard or mouse to select it. 38 | 39 | ## Automatic Formatting 40 | Want to automatically format your text? 41 | Install **StandardFormat** from package control! (Check the [sublime-standard-format](https://github.com/bcomnes/sublime-standard-format) repository for details) 42 | 43 | 44 | ## Settings 45 | For general information on how SublimeLinter works with settings, please see [Settings][settings]. For information on generic linter settings, please see [Linter Settings][linter-settings]. 46 | 47 | ## Contributing 48 | If you would like to contribute enhancements or fixes, please do the following: 49 | 50 | 1. Fork the plugin repository. 51 | 1. Hack on a separate topic branch created from the latest `master`. 52 | 1. Commit and push the topic branch. 53 | 1. Make a pull request. 54 | 1. Be patient. ;-) 55 | 56 | Please note that modifications should follow these coding guidelines: 57 | 58 | - Indent is 4 spaces. 59 | - Code should pass flake8 and pep257 linters. 60 | - Vertical whitespace helps readability, don’t be afraid to use it. 61 | - Please use descriptive variable names, no abbreviations unless they are very well known. 62 | 63 | Thank you for helping out! 64 | 65 | [docs]: http://sublimelinter.readthedocs.org 66 | [installation]: http://sublimelinter.readthedocs.org/en/latest/installation.html 67 | [locating-executables]: http://sublimelinter.readthedocs.org/en/latest/usage.html#how-linter-executables-are-located 68 | [pc]: https://sublime.wbond.net/installation 69 | [cmd]: http://docs.sublimetext.info/en/sublime-text-3/extensibility/command_palette.html 70 | [settings]: http://sublimelinter.readthedocs.org/en/latest/settings.html 71 | [linter-settings]: http://sublimelinter.readthedocs.org/en/latest/linter_settings.html 72 | [inline-settings]: http://sublimelinter.readthedocs.org/en/latest/settings.html#inline-settings 73 | --------------------------------------------------------------------------------