pronto-eslint 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/README.md +2 -1
- data/lib/pronto/eslint.rb +15 -3
- data/lib/pronto/eslint/version.rb +1 -1
- data/pronto-eslint.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bdbb959f4a57697c6287a9f4ed142efae5def14a
|
4
|
+
data.tar.gz: 73e05d0c782f5f78cd07e5bb4dfcf3e9db1f5137
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73cd65265af5683ee891fe8327ee30cfbf2035aaf37e7ca95183445955b017465bd9550bbb9e7af1eecfc7ce84b2bba893023a5bf6167784b4c434738537be28
|
7
|
+
data.tar.gz: b80d5455c3a65727054ea681a296a666122c77320ef48f1a19f119347141548f30c4243ab7521c9254976dad2dcb83648f727366152cfae8f548a231a9a59fcc
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -13,4 +13,5 @@ You'll need to install one of the runtimes supported by [ExecJS](https://github.
|
|
13
13
|
|
14
14
|
## Configuration
|
15
15
|
|
16
|
-
Configuring ESLint via .eslintrc will work just fine with pronto-eslint
|
16
|
+
Configuring ESLint via .eslintrc will work just fine with pronto-eslint, though it will not support
|
17
|
+
searching higher up the path hierarch. To use an absolute path to your config, use `ESLINT_CONFIG`.
|
data/lib/pronto/eslint.rb
CHANGED
@@ -13,18 +13,30 @@ module Pronto
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def inspect(patch)
|
16
|
-
options = File.exist?('.eslintrc') ? :eslintrc : :defaults
|
17
16
|
offences = Eslintrb.lint(patch.new_file_full_path, options).compact
|
18
17
|
|
18
|
+
fatals = offences.select { |offence| offence['fatal'] }
|
19
|
+
.map { |offence| new_message(offence, nil) }
|
20
|
+
|
21
|
+
return fatals if fatals && !fatals.empty?
|
22
|
+
|
19
23
|
offences.map do |offence|
|
20
24
|
patch.added_lines.select { |line| line.new_lineno == offence['line'] }
|
21
25
|
.map { |line| new_message(offence, line) }
|
22
26
|
end
|
23
27
|
end
|
24
28
|
|
29
|
+
def options
|
30
|
+
if ENV['ESLINT_CONFIG']
|
31
|
+
JSON.parse(IO.read(ENV['ESLINT_CONFIG']))
|
32
|
+
else
|
33
|
+
File.exist?('.eslintrc') ? :eslintrc : :defaults
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
25
37
|
def new_message(offence, line)
|
26
|
-
path = line.patch.delta.new_file[:path]
|
27
|
-
level = :warning
|
38
|
+
path = line ? line.patch.delta.new_file[:path] : '.eslintrc'
|
39
|
+
level = line ? :warning : :fatal
|
28
40
|
|
29
41
|
Message.new(path, line, level, offence['message'], nil, self.class)
|
30
42
|
end
|
data/pronto-eslint.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pronto-eslint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mindaugas Mozūras
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pronto
|
@@ -111,7 +111,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
111
111
|
requirements:
|
112
112
|
- - ">="
|
113
113
|
- !ruby/object:Gem::Version
|
114
|
-
version:
|
114
|
+
version: 2.0.0
|
115
115
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
116
116
|
requirements:
|
117
117
|
- - ">="
|
@@ -119,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
119
119
|
version: '0'
|
120
120
|
requirements: []
|
121
121
|
rubyforge_project:
|
122
|
-
rubygems_version: 2.
|
122
|
+
rubygems_version: 2.5.1
|
123
123
|
signing_key:
|
124
124
|
specification_version: 4
|
125
125
|
summary: Pronto runner for ESLint, pluggable linting utility for JavaScript and JSX
|