+---
AllCops:
DisplayCopNames: true
DisplayStyleGuide: true
+ TargetRubyVersion: 2.1.0
Documentation:
Enabled: false
-Metrics/MethodLength:
- Max: 20
+Layout/ExtraSpacing:
+ ForceEqualSignAlignment: true
-Metrics/LineLength:
- Max: 100
+Layout/MultilineMethodCallIndentation:
+ Enabled: false
+
+Lint/AmbiguousBlockAssociation:
+ Enabled: false
Metrics/AbcSize:
- Max: 20
+ Max: 40
+
+Metrics/BlockLength:
+ Enabled: false
+
+Metrics/ClassLength:
+ Max: 200
+
+Metrics/CyclomaticComplexity:
+ Max: 15
+
+Metrics/LineLength:
+ Max: 120
+
+Metrics/MethodLength:
+ Max: 30
Metrics/ParameterLists:
Max: 10
+
+Rails:
+ Enabled: true
+
+Rails/InverseOf:
+ Enabled: false
+
+Rails/LexicallyScopedActionFilter:
+ Enabled: false
+
+Rails/SkipsModelValidations:
+ Enabled: false
+
+Rails/UnknownEnv:
+ Enabled: false
+
+Style/FormatStringToken:
+ Enabled: false
+# frozen_string_literal: true
+
require 'pronto'
require 'shellwords'
module Pronto
class ESLintNpm < Runner
CONFIG_FILE = '.pronto_eslint_npm.yml'.freeze
- CONFIG_KEYS = %w(eslint_executable files_to_lint).freeze
+ CONFIG_KEYS = %w[eslint_executable files_to_lint].freeze
attr_writer :eslint_executable
def eslint_executable
- @eslint_executable || 'eslint'.freeze
+ @eslint_executable || 'eslint'
end
def files_to_lint
end
def new_message(offence, line)
- path = line.patch.delta.new_file[:path]
+ path = line.patch.delta.new_file[:path]
level = :warning
Message.new(path, line, level, offence['message'], nil, self.class)
-# -*- encoding: utf-8 -*-
+# frozen_string_literal: true
-$LOAD_PATH.push File.expand_path('../lib', __FILE__)
+$LOAD_PATH.push File.expand_path('lib', __dir__)
require 'pronto/eslint_npm/version'
Gem::Specification.new do |s|
- s.name = 'pronto-eslint_npm'
- s.version = Pronto::ESLintNpmVersion::VERSION
+ s.name = 'pronto-eslint_npm'
+ s.version = Pronto::ESLintNpmVersion::VERSION
s.platform = Gem::Platform::RUBY
- s.authors = ['Markus Doits', 'Mindaugas Mozūras']
- s.email = 'markus.doits@gmail.com'
+ s.authors = ['Markus Doits', 'Mindaugas Mozūras']
+ s.email = 'markus.doits@gmail.com'
s.homepage = 'https://github.com/doits/pronto-eslint_npm'
- s.summary = <<-EOF
+ s.summary = <<-EOF
Pronto runner for ESLint, pluggable linting utility for JavaScript and JSX
EOF
- s.licenses = ['MIT']
+ s.licenses = ['MIT']
s.required_ruby_version = '>= 2.0.0'
- s.files = `git ls-files -z`.split("\x0").select { |f| f.match(%r{^(lib/|(LICENSE|README.md)$)}) }
+ s.files = `git ls-files -z`.split("\x0").select { |f| f.match(%r{^(lib/|(LICENSE|README.md)$)}) }
s.extra_rdoc_files = ['LICENSE', 'README.md']
- s.require_paths = ['lib']
+ s.require_paths = ['lib']
s.requirements << 'eslint (in PATH)'
s.add_dependency('pronto', '~> 0.9.1')
+ s.add_development_dependency('byebug', '>= 9')
s.add_development_dependency('rake', '>= 11.0', '< 13')
s.add_development_dependency('rspec', '~> 3.4')
- s.add_development_dependency('byebug', '>= 9')
end
+# frozen_string_literal: true
+
require 'fileutils'
require 'byebug'
require 'rspec'
require 'pronto/eslint_npm'
-%w(test eslintignore).each do |repo_name|
+%w[test eslintignore].each do |repo_name|
RSpec.shared_context "#{repo_name} repo" do
let(:git) { "spec/fixtures/#{repo_name}.git/git" }
let(:dot_git) { "spec/fixtures/#{repo_name}.git/.git" }