coffeelint 1.16.0 → 1.16.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 +4 -4
- data/README.md +1 -1
- data/coffeelint.gemspec +1 -1
- data/coffeelint/lib/coffeelint.js +22 -43
- data/lib/coffeelint/version.rb +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: b7a4a2035e21315450af30547f9240faafc6b22f
|
4
|
+
data.tar.gz: e360a0cc21d61d9cab4875b8e21158608b61ac9b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d25210e7bfdf55cea135038df5388dc12242219a4c23fcf70d6e0f3471b0d95351d3d8ebbfd6b9ea884a433ef76cdce0fa0121f4e12c565db7d87a7e4617d4dd
|
7
|
+
data.tar.gz: 4885fca9294e012e30e2cce5b9b4ecef08e32726e8482e2dd7adeff1ef002e905006840d400bcec983e73cd96044a0ebe9675ea6941ea0011da1ebc497e97a03
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Coffeelint [](https://travis-ci.org/zmbush/coffeelint-ruby) [](http://badge.fury.io/rb/coffeelint)
|
2
2
|
|
3
|
-
Using coffeelint version: v1.16.
|
3
|
+
Using coffeelint version: v1.16.1
|
4
4
|
|
5
5
|
Coffeelint is a set of simple ruby bindings for [coffeelint](https://github.com/clutchski/coffeelint).
|
6
6
|
|
data/coffeelint.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
module.exports={
|
3
3
|
"name": "coffeelint",
|
4
4
|
"description": "Lint your CoffeeScript",
|
5
|
-
"version": "1.16.
|
5
|
+
"version": "1.16.1",
|
6
6
|
"homepage": "http://www.coffeelint.org",
|
7
7
|
"keywords": [
|
8
8
|
"lint",
|
@@ -1685,21 +1685,37 @@ module.exports = Indentation = (function() {
|
|
1685
1685
|
|
1686
1686
|
Indentation.prototype.tokens = ['INDENT', '[', ']', '.'];
|
1687
1687
|
|
1688
|
-
Indentation.prototype.keywords = ['->', '=>', '@', 'CATCH', 'CLASS', 'ELSE', 'FINALLY', 'FOR', 'FORIN', 'FOROF', 'IDENTIFIER', 'IF', 'LEADING_WHEN', 'LOOP', 'RETURN', 'SWITCH', 'THROW', 'TRY', 'UNTIL', 'WHEN', 'WHILE', 'YIELD'];
|
1688
|
+
Indentation.prototype.keywords = ['->', '=>', '@', 'CATCH', 'CLASS', 'ELSE', 'FINALLY', 'FOR', 'FORIN', 'FOROF', 'IDENTIFIER', 'IF', 'LEADING_WHEN', 'LOOP', 'PROPERTY', 'RETURN', 'SWITCH', 'THROW', 'TRY', 'UNTIL', 'WHEN', 'WHILE', 'YIELD'];
|
1689
1689
|
|
1690
1690
|
function Indentation() {
|
1691
1691
|
this.arrayTokens = [];
|
1692
1692
|
}
|
1693
1693
|
|
1694
1694
|
Indentation.prototype.lintToken = function(token, tokenApi) {
|
1695
|
-
var currentLine, expected, ignoreIndent, isArrayIndent, isMultiline, lineNumber, lines, numIndents, previous, previousSymbol, ref, ref1, ref2, type;
|
1696
|
-
type = token[0], numIndents = token[1]
|
1695
|
+
var chain, currentLine, dotIndent, expected, got, ignoreIndent, isArrayIndent, isMultiline, lineNumber, lines, next, numIndents, previous, previousSymbol, ref, ref1, ref2, startsWith, type;
|
1696
|
+
type = token[0], numIndents = token[1];
|
1697
|
+
dotIndent = token[2].first_column;
|
1697
1698
|
lines = tokenApi.lines, lineNumber = tokenApi.lineNumber;
|
1698
1699
|
expected = tokenApi.config[this.rule.name].value;
|
1699
1700
|
if (type === '.') {
|
1700
1701
|
currentLine = lines[lineNumber];
|
1701
|
-
if (((
|
1702
|
-
|
1702
|
+
if (((ref = currentLine.match(/\S/)) != null ? ref[0] : void 0) === '.') {
|
1703
|
+
next = tokenApi.peek(1);
|
1704
|
+
if (next[0] === 'PROPERTY') {
|
1705
|
+
chain = '.' + next[1];
|
1706
|
+
startsWith = new RegExp('\\S{' + chain.length + '}');
|
1707
|
+
if (((ref1 = currentLine.match(startsWith)) != null ? ref1[0] : void 0) === chain) {
|
1708
|
+
got = dotIndent;
|
1709
|
+
if (dotIndent - expected > expected) {
|
1710
|
+
got %= expected;
|
1711
|
+
}
|
1712
|
+
if (dotIndent % expected !== 0) {
|
1713
|
+
return {
|
1714
|
+
context: "Expected " + expected + " got " + got
|
1715
|
+
};
|
1716
|
+
}
|
1717
|
+
}
|
1718
|
+
}
|
1703
1719
|
}
|
1704
1720
|
return void 0;
|
1705
1721
|
}
|
@@ -1736,43 +1752,6 @@ module.exports = Indentation = (function() {
|
|
1736
1752
|
return null;
|
1737
1753
|
};
|
1738
1754
|
|
1739
|
-
Indentation.prototype.handleChain = function(tokenApi, expected) {
|
1740
|
-
var callStart, checkNum, currIsIndent, currentLine, currentSpaces, findCallStart, lastCheck, lineNumber, lines, numIndents, prevIsIndent, prevLine, prevNum, prevSpaces, ref, ref1;
|
1741
|
-
lastCheck = 1;
|
1742
|
-
callStart = 1;
|
1743
|
-
prevNum = 1;
|
1744
|
-
lineNumber = tokenApi.lineNumber, lines = tokenApi.lines;
|
1745
|
-
currentLine = lines[lineNumber];
|
1746
|
-
findCallStart = tokenApi.peek(-callStart);
|
1747
|
-
while (findCallStart && findCallStart[0] !== 'TERMINATOR') {
|
1748
|
-
lastCheck = findCallStart[2].first_line;
|
1749
|
-
callStart += 1;
|
1750
|
-
findCallStart = tokenApi.peek(-callStart);
|
1751
|
-
}
|
1752
|
-
while ((lineNumber - prevNum > lastCheck) && !/^\s*\./.test(lines[lineNumber - prevNum])) {
|
1753
|
-
prevNum += 1;
|
1754
|
-
}
|
1755
|
-
checkNum = lineNumber - prevNum;
|
1756
|
-
if (checkNum >= 0) {
|
1757
|
-
prevLine = lines[checkNum];
|
1758
|
-
if (prevLine.match(/\S/)[0] === '.' || checkNum === lastCheck) {
|
1759
|
-
currentSpaces = (ref = currentLine.match(/\S/)) != null ? ref.index : void 0;
|
1760
|
-
prevSpaces = (ref1 = prevLine.match(/\S/)) != null ? ref1.index : void 0;
|
1761
|
-
numIndents = currentSpaces - prevSpaces;
|
1762
|
-
prevIsIndent = prevSpaces % expected !== 0;
|
1763
|
-
currIsIndent = currentSpaces % expected !== 0;
|
1764
|
-
if (prevIsIndent && currIsIndent) {
|
1765
|
-
numIndents = currentSpaces;
|
1766
|
-
}
|
1767
|
-
if (numIndents % expected !== 0) {
|
1768
|
-
return {
|
1769
|
-
context: "Expected " + expected + " got " + numIndents
|
1770
|
-
};
|
1771
|
-
}
|
1772
|
-
}
|
1773
|
-
}
|
1774
|
-
};
|
1775
|
-
|
1776
1755
|
Indentation.prototype.grabLineTokens = function(tokenApi, lineNumber, all) {
|
1777
1756
|
var i, k, len, len1, ref, ref1, results, results1, tok, tokensByLine;
|
1778
1757
|
if (all == null) {
|
data/lib/coffeelint/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coffeelint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.16.
|
4
|
+
version: 1.16.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zachary Bush
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: coffee-script
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 3.
|
61
|
+
version: 3.4.0
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 3.
|
68
|
+
version: 3.4.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rake
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|