pronto-eslint 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 26d8ca82c9e76866f90fcb8014e54c8e09b690dd
4
- data.tar.gz: 18bc157044c65c4e9f213b1be3bd425bddb32d4f
3
+ metadata.gz: bdbb959f4a57697c6287a9f4ed142efae5def14a
4
+ data.tar.gz: 73e05d0c782f5f78cd07e5bb4dfcf3e9db1f5137
5
5
  SHA512:
6
- metadata.gz: 46252b62e2889609d2f33f5a61e5b509edb52891c2a4f6bd1de627d5622d4e09f6b6326aa5e638953f79e72df33ccecc202fdde159e2ae214766fe2b919c4354
7
- data.tar.gz: 48815df495d80fc3fe8a9166fe830ae05eaab1b23c435147eed53c4a9404b2d6f7f166d3f7baa7ed49a19a79a6fce00c86a75b685262a1fb033b61d6a203f557
6
+ metadata.gz: 73cd65265af5683ee891fe8327ee30cfbf2035aaf37e7ca95183445955b017465bd9550bbb9e7af1eecfc7ce84b2bba893023a5bf6167784b4c434738537be28
7
+ data.tar.gz: b80d5455c3a65727054ea681a296a666122c77320ef48f1a19f119347141548f30c4243ab7521c9254976dad2dcb83648f727366152cfae8f548a231a9a59fcc
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License
2
2
 
3
- Copyright (c) 2016 Mindaugas Mozūras
3
+ Copyright (c) 2017 Mindaugas Mozūras
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
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`.
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Pronto
2
2
  module ESLintVersion
3
- VERSION = '0.7.0'.freeze
3
+ VERSION = '0.7.1'.freeze
4
4
  end
5
5
  end
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
16
16
  EOF
17
17
 
18
18
  s.licenses = ['MIT']
19
- s.required_ruby_version = '>= 1.9.3'
19
+ s.required_ruby_version = '>= 2.0.0'
20
20
  s.rubygems_version = '1.8.23'
21
21
 
22
22
  s.files = `git ls-files`.split($RS).reject do |file|
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.0
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: 2016-08-07 00:00:00.000000000 Z
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: 1.9.3
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.4.5
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