You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This linter plugin for [SublimeLinter][docs] provides an interface to [ESLint](https://github.com/nzakas/eslint). It will be used with files that have the “javascript” syntax.
4
+
This linter plugin for [SublimeLinter](https://github.com/SublimeLinter/SublimeLinter) provides an interface to [ESLint](https://github.com/nzakas/eslint). It will be used with files that have the “javascript” syntax.
5
5
6
6
## Installation
7
-
SublimeLinter 3 must be installed in order to use this plugin. If SublimeLinter 3 is not installed, please follow the instructions [here][installation].
7
+
SublimeLinter 3 must be installed in order to use this plugin.
8
8
9
-
### Linter installation
10
-
Before using this plugin, you must ensure that `eslint` is installed on your system. To install `eslint`, do the following:
11
-
12
-
1. Install [Node.js](http://nodejs.org) (and [npm](https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager) on Linux).
13
-
14
-
1. Install `eslint` globally by typing the following in a terminal:
15
-
```
16
-
npm install -g eslint
17
-
```
18
-
Or install `eslint` locally in your project folder (**you must have package.json file there**):
19
-
```
20
-
npm init -f
21
-
npm install eslint
22
-
```
23
-
24
-
1. Init `eslint` config if you don't have any. Run in your code folder:
25
-
26
-
```
27
-
eslint --init
28
-
```
29
-
30
-
or if `eslint` is installed locally
31
-
32
-
```
33
-
./node_modules/.bin/eslint --init
34
-
```
35
-
36
-
Reopen your project next (or restart ST) to make sure local `eslint` will be used.
37
-
38
-
1. If you are using `nvm` and `zsh`, ensure that the line to load `nvm` is in `.zprofile` and not `.zshrc`.
39
-
40
-
1. If you are using `zsh` and `oh-my-zsh`, do not load the `nvm` plugin for `oh-my-zsh`.
9
+
Please install via [Package Control](https://sublime.wbond.net/installation).
41
10
42
-
Once you have installed `eslint` you can proceed to install the SublimeLinter-eslint plugin if it is not yet installed.
43
-
44
-
**Note:** This plugin requires `eslint` 2.0.0 or later.
11
+
Before using this plugin, you must ensure that `eslint` is installed on your system. To install `eslint`, do the following:
45
12
46
-
### Plugin installation
47
-
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.
13
+
- Install [Node.js](http://nodejs.org) (and [npm](https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager) on Linux).
48
14
49
-
To install via Package Control, do the following:
15
+
- Install `eslint` globally by typing the following in a terminal:
16
+
```
17
+
npm install -g eslint
18
+
```
19
+
20
+
- Or install `eslint` locally in your project folder (**you must have package.json file there**):
21
+
```
22
+
npm install eslint
23
+
```
50
24
51
-
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.
52
25
53
-
1. When the plugin list appears, type `eslint`. Among the entries you should see `SublimeLinter-eslint`. If that entry is not highlighted, use the keyboard or mouse to select it.
54
26
55
27
## Settings
56
-
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].
57
28
58
-
You can configure `eslint` options in the way you would from the command line, with `.eslintrc` files. For more information, see the [eslint docs](https://github.com/nzakas/eslint/wiki).
##### What is my first step to find out what trouble I have?
63
-
64
-
Use SublimeText console and SublimeLinter debug mode.
32
+
You can configure `eslint` options in the way you would from the command line, with `.eslintrc` files. For more information, see the [eslint docs](https://github.com/nzakas/eslint/wiki).
65
33
66
-
1. Check `Tools -> SublimeLinter -> Debug Mode`.
67
-
2. Open console `View -> Show Console`.
68
34
69
-
Then open any JS file and run `Tools -> SublimeLinter -> Lint This View`. It must be an output in console after, something like that:
##### I've got 'SublimeLinter: ERROR: eslint cannot locate 'eslint' in ST console when I try to use locally installed `eslint`.
38
+
### I've got 'SublimeLinter: ERROR: eslint cannot locate 'eslint' in ST console when I try to use locally installed `eslint`.
76
39
77
40
You **must** have `package.json` file if install `eslint` locally. Also, restart project or ST itself after to make sure SublimeLinter uses correct `eslint` instance.
78
41
@@ -81,59 +44,6 @@ npm init -f
81
44
npm install eslint
82
45
```
83
46
84
-
##### Plugin still does not work or there are errors in ST console.
85
-
86
-
Update `eslint` instance, probably you use outdated version and SublimeLinter does not check it properly sometimes.
87
-
88
-
##### I want to use custom rules, global `.eslintignore` file, etc.
89
-
90
-
You can specify **any** [CLI options](http://eslint.org/docs/user-guide/command-line-interface#options) of `eslint` with `args` key in SublimeLinter configs.
91
-
92
-
```json
93
-
{
94
-
"linters": {
95
-
"eslint": {
96
-
"args": [
97
-
"--ignore-path", "~/eslint_ignore",
98
-
"--rulesdir", "~/rules"
99
-
]
100
-
}
101
-
}
102
-
}
103
-
```
104
-
105
-
##### There is no `SublimeLinter-eslint` package to install in Package Control packages list.
106
-
107
-
Check if you already have it installed, please.
108
-
109
-
##### It's not linting for JSX.
110
-
111
-
Try changing your syntax from JSX to Babel > Javascript. ([ref issue](https://github.com/roadhump/SublimeLinter-eslint/issues/106))
112
-
113
-
## Contributing
114
-
If you would like to contribute enhancements or fixes, please do the following:
115
-
116
-
1. Fork the plugin repository.
117
-
1. Hack on a separate topic branch created from the latest `master`.
118
-
1. Commit and push the topic branch.
119
-
1. Make a pull request.
120
-
1. Be patient. ;-)
121
-
122
-
Please note that modifications should follow these coding guidelines:
123
47
124
-
- Indent is 4 spaces.
125
-
- Code should pass flake8 and pep257 linters.
126
-
- Vertical whitespace helps readability, so don’t be afraid to use it.
127
-
- Please use descriptive variable names, so no abbreviations unless they are very well known.
0 commit comments