eslint-plugin-flowtype-errors
Advanced tools
Comparing version 3.0.3 to 3.1.0-0
@@ -0,1 +1,11 @@ | ||
## v3.0.3 | ||
### Fixed | ||
- Fixed bug that suppressed jsx errors | ||
## v3.0.2 | ||
### Updated | ||
- `flow-bin@0.39.0` -> `flow-bin@0.42.0` | ||
## v3.0.1 | ||
@@ -2,0 +12,0 @@ |
@@ -15,3 +15,3 @@ 'use strict'; | ||
exports.default = Collect; | ||
exports.default = collect; | ||
@@ -180,5 +180,5 @@ var _path = require('path'); | ||
function Collect(stdin, root, filepath) { | ||
return executeFlow(stdin, root, filepath, {}); | ||
function collect(stdin, root, filepath) { | ||
return executeFlow(stdin, root, filepath); | ||
} | ||
module.exports = exports['default']; |
@@ -23,2 +23,9 @@ 'use strict'; | ||
function hasFlowPragma(source) { | ||
return source.getAllComments().some(function (comment) { | ||
return (/@flow/.test(comment.value) | ||
); | ||
}); | ||
} | ||
exports.default = { | ||
@@ -33,3 +40,3 @@ rules: { | ||
if (onTheFly) { | ||
var stdin = context.getSourceCode().getText(); | ||
var source = context.getSourceCode(); | ||
var root = process.cwd(); | ||
@@ -46,12 +53,7 @@ | ||
if (stdin) { | ||
if (runOnAllFiles === false) { | ||
// `String.prototype.includes` is an O(n) operation :( | ||
if (!stdin.includes('@flow')) { | ||
return true; | ||
} | ||
} | ||
if (runOnAllFiles === false && !hasFlowPragma(source)) { | ||
return true; | ||
} | ||
collected = (0, _collect2.default)(stdin, root, context.getFilename()); | ||
collected = (0, _collect2.default)(source.getText(), root, context.getFilename()); | ||
} else { | ||
@@ -58,0 +60,0 @@ collected = (0, _collect2.default)(); |
{ | ||
"name": "eslint-plugin-flowtype-errors", | ||
"version": "3.0.3", | ||
"version": "3.1.0-0", | ||
"description": "Retrieve Flow errors as ESLint errors.", | ||
@@ -13,3 +13,3 @@ "author": "Amila Welihinda", | ||
"build": "cross-env NODE_ENV=production babel src --out-dir dist", | ||
"lint": "eslint --ignore-path .gitignore --cache --format=node_modules/eslint-formatter-pretty .", | ||
"lint": "eslint --cache --format=node_modules/eslint-formatter-pretty .", | ||
"preversion": "npm run build", | ||
@@ -51,2 +51,3 @@ "spec": "npm run build && jest test/format.spec.js", | ||
"cross-env": "^3.2.4", | ||
"cross-spawn": "^5.1.0", | ||
"eslint": "^3.18.0", | ||
@@ -53,0 +54,0 @@ "eslint-config-airbnb-base": "^11.1.1", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16534
260
18
1