UNPKG

3.08 kBMarkdownView Raw
1# apexlint
2
3[![npm version](https://badge.fury.io/js/apexlint.svg)](https://badge.fury.io/js/apexlint) [![travis-ci](https://travis-ci.org/renatoliveira/apexlint.svg?branch=master)](https://travis-ci.org/renatoliveira/apexlint)
4
5An Apex linter written in TypeScript (work in progress)
6
7## About this repository
8
9As the title says, this is a work in progress linter for the Apex language.
10
11I'm building this to assist me with writing better code for the Salesforce ☁ platform. Think about simple stuff like line length, method names, and some styling. I do plan, in the long run, if everything I mentioned before works, to make this work for checking types and references (even though those are caught at compile-time by the platform, for some of us it would be nice to have those errors handled before sending the files to the platform's servers).
12
13Other reasons to create this thing is to learn how to write a linter, because there are no How To's online (at least not as of 4 Mar 2018).
14
15## Some things that are nice and would be nice to have
16
17* [ ] Be able to run the linter from the command line (should be a priority when getting more items done in this list)
18* [x] Make the linter read and sort the code by contexts.
19* [ ] Make the linter able to distinguish between context types (class scope, method scope, etc).
20* [x] Basic rules with error outputs, like maximum line length.
21* [x] Detect SOQL statements used in one line
22* [ ] Detect SOQL statements inside `for` loops as list variable.
23* [ ] Basic detection of SOQL statements inside loop structures.
24* and more...
25
26## Installation
27
28This tool can be installed with npm or yarn, and you should link it for it to be available globally.
29
30Like this on npm:
31
32```npm install apexlint -g```
33
34Or this with yarn:
35
36```yarn global add apexlint```
37
38## Uninstall
39
40Using npm, you can uninstall it by issuing the same install command, but r
41replacing `install` with `uninstall`:
42
43```npm uninstall apexlint -g```
44
45or, with yarn:
46
47```yarn global remove apexlint```
48
49## License
50
51Copyright 2018 Renato Oliveira
52
53Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
54
55The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
56
57THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
58
\No newline at end of file